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

--- Comment #0 from 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!(int[1u] function()) error

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to