[Issue 24247] New: Improve constructor not callable using $modifier object error
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Thu Nov 16 16:20:06 UTC 2023
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24247
          Issue ID: 24247
           Summary: Improve constructor not callable using $modifier
                    object error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: nick at geany.org
struct S1
{
    this(ref const S1 s) immutable {
    }
    int i;
}
void main()
{
    const(S1) s1;
    S1 ms1 = s1;
}
Error: `immutable` method `immutable_ctor.S1.this` is not callable using a
mutable object
This should be changed to:
Error: `immutable` constructor `immutable_ctor.S1.this` cannot construct a
mutable object
--
    
    
More information about the Digitalmars-d-bugs
mailing list