[Issue 14965] [REG2.031] Forward reference to inferred return type of function call when using auto return type
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Mon Mar  7 12:06:49 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=14965
--- Comment #5 from github-bugzilla at puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/4b6779d2ff0b95866205189cb55e5aef00c13c7e
fix Issue 14965 - Forward reference to inferred return type of function call
when using auto return type
If a function symbol is used, its overload resolution should be deferred until:
```d
func(...)           // CallExp.semantic
func.mangleof       // DotIdExp.semanticY
typeof(func)        // TypeTypeof.resolve
typeof(&func)       // TypeTypeof.resolve
auto v = &func;     // ExpInitializer.inferType
&func;              // ExpStatement.semantic
return &func;       // ReturnStatement
```
When the semantic analysis reaches to them, the function forward reference can
beome actual error.
Other use of 'func' should be treated as a property-like function call (done in
`resolveProperties`) and finally handled in `CallExp`.
https://github.com/D-Programming-Language/dmd/commit/624ad66c0bbfdfad8c5c1fc95339f77ac3659694
Merge pull request #5202 from 9rnsr/fix14965
[REG2.031] Issue 14965 - Forward reference to inferred return type of function
call when using auto return type
--
    
    
More information about the Digitalmars-d-bugs
mailing list