[Issue 14163] New: No line number for error with disabled class constructor

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Feb 10 01:21:17 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14163

          Issue ID: 14163
           Summary: No line number for error with disabled class
                    constructor
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

class Foo {
    @disable this();
}
class Bar : Foo {
    @disable this();
    this(int i) {}
}
void main() {}



Gives no line number in the error message:

Error: constructor test.Foo.this is not callable because it is annotated with
@disable


Additionally this gives a linker error, but perhaps the front-end should catch
this at compile-time:


class Foo {
    @disable this();
    this(int i) {}
}
void main() {}


test.obj(test) 
 Error 42: Symbol Undefined _D4test3Foo6__ctorMFZC4test3Foo

--


More information about the Digitalmars-d-bugs mailing list