[Issue 12194] Constructor prevents static opCall regression?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 18 18:41:26 PST 2014


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



--- Comment #8 from Kenji Hara <k.hara.pg at gmail.com> 2014-02-18 18:41:25 PST ---
(In reply to comment #0)
>  this of course means tracking down the places which need
> fixed is not helped by the compiler.

> this of course means tracking down the places which need
fixed is not helped by the compiler.

You can make error at the all places that using `static Struct opCall()`, by
replacing it to `@disable this();`.

> void main() {
>     assert(Struct() == Struct(2));
> }
> 
> struct Struct {
>     int a;
>     this(int a) {
>         this.a = a;
>     }

    @disable this();
    //static Struct opCall() {
    //    return Struct(2);
    //}

> }

--------
test.d(2): Error: constructor test.Struct.this is not callable because it is
annotated with @disable

-- 
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