[Issue 17518] New: confusing error message with inout constructor/ctor
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sat Jun 17 11:21:21 PDT 2017
    
    
  
https://issues.dlang.org/show_bug.cgi?id=17518
          Issue ID: 17518
           Summary: confusing error message with inout constructor/ctor
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu
cat > bug.d << CODE
struct S
{
    this(inout Correct) inout
    {
    }
}
struct Correct {}
struct Wrong {}
S bug()
{
    return S(Wrong());
}
CODE
dmd -c bug
----
bug.d(13): Error: inout method bug.S.this is not callable using a mutable
object
----
The error should point out that the wrong type is passed, not that it's
mutable.
--
    
    
More information about the Digitalmars-d-bugs
mailing list