www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12322] New: Bad error message with wrong Nullable array argument

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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: -------
Mar 08 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12322




See also Issue 12323

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