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: nob...@puremagic.com
          Reporter: and...@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.

--

Reply via email to