Summary: Better object array literal type inference
           Product: D
           Version: future
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-03-30 02:59:07 PDT ---
In the following D2 program the compiler can refuse the line 6, because it must
refuse to guess (if p1 is an array of A or B).

But at line 7 the compiler has enough information to not guess (it's an array
of A), so line 7 can be accepted by the compiler:

class A {}
class B : A {}
final class C1 : B {}
final class C2 : B {}
void main() {
    auto p1 = [new C1, new C2]; // line 6, don't guess
    A[]  p2 = [new C1, new C2]; // line 7, no need to guess

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

Reply via email to