View mode: basic / threaded / horizontal-split · Log in · Help
March 07, 2012
[Issue 7662] New: int[1u] not implicitly convertible to immutable
http://d.puremagic.com/issues/show_bug.cgi?id=7662

          Summary: int[1u] not implicitly convertible to immutable
          Product: D
          Version: D2
         Platform: x86
       OS/Version: Windows
           Status: NEW
         Keywords: rejects-valid
         Severity: normal
         Priority: P2
        Component: DMD
       AssignedTo: nobody@puremagic.com
       ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2012-03-07 10:55:47 PST ---
Maybe related to issue 7661

I think the assignment at line 5 has to be valid, because int[1] is a value
that gets copied to another immutable value:


int[1] foo() {
   return [1];
}
void bar(F)(F fun) {
   immutable x = fun(); // line 5
}
void main() {
   bar(&foo); // line 8
}


test.d(5): Error: cannot implicitly convert expression ((*fun)()) of type
int[1u] to immutable(int)[]
test.d(8): Error: template instance test.bar!(int[1u] function()) error
instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 10, 2013
[Issue 7662] int[1u] not implicitly convertible to immutable
http://d.puremagic.com/issues/show_bug.cgi?id=7662


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
            Status|NEW                         |RESOLVED
                CC|                            |andrej.mitrovich@gmail.com
        Resolution|                            |WORKSFORME


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-01-10 15:03:08 PST ---
Works in 2.061+

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home