[Issue 14693] New: @property return type not generated in .di file

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jun 12 13:42:42 PDT 2015


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

          Issue ID: 14693
           Summary: @property return type not generated in .di file
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andrei at erdani.com

Repro:

struct A {
    @property foo() { return 42; }
}

This is correct code, the fact that foo is a function is inferred from the
presence of @property, and the return type is deduced automatically from the
body. However, if a .di file is generated it'll have this code:

struct A {
    @property foo();
}

which is incorrect D.

Solution: keep the bodies of functions with automatically inferred type in the
.di file.

--


More information about the Digitalmars-d-bugs mailing list