www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14693] New: property return type not generated in .di file


          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 puremagic.com
          Reporter: andrei erdani.com


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.

Jun 12 2015