[Issue 12322] New: Bad error message with wrong Nullable array argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 8 14:09:32 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12322

           Summary: Bad error message with wrong Nullable array argument
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2014-03-08 14:09:29 PST ---
import std.typecons: Nullable;
alias Foo = int[5];
alias NFoo = Nullable!Foo;
NFoo bar1() {
    int[] a;
    return NFoo(a); // Error
}
NFoo bar2() {
    immutable int[] b;
    return NFoo(b); // Error
}
void main() {}



dmd 2.066alpha gives error messages that I think could be better:

test.d(6,16): Error: inout method std.typecons.Nullable!(int[5]).Nullable.this
is not callable using a mutable object
test.d(10,16): Error: inout method std.typecons.Nullable!(int[5]).Nullable.this
is not callable using a mutable object

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list