Bug 12688 – Strange error if function call is in parentheses

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-01T10:49:00Z
Last change time
2015-03-25T05:08:31Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
temtaime

Comments

Comment #0 by temtaime — 2014-05-01T10:49:20Z
import std.stdio; struct S { int foo() @property { return 1; } } void main() { S s; s.foo.writeln; // ok (s.foo).writeln; // Error: need 'this' for 'foo' of type '@property int()' }
Comment #1 by k.hara.pg — 2014-05-04T11:19:44Z
Comment #2 by github-bugzilla — 2014-05-04T19:16:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/498d260ff2bced1135e4aabee920b6e1704386f2 fix Issue 12688 - Strange error if function call is in parentheses `(s.foo).writeln` is parsed as `DotIdExp(TypeExp('s.foo'), 'writeln')`, but the type `s.foo` should be analyzed as dotvar expression. https://github.com/D-Programming-Language/dmd/commit/fd09d6b4936fd2a9a45a33451e493f627962cb0c Merge pull request #3524 from 9rnsr/fix12688 Issue 12688 - Strange error if function call is in parentheses
Comment #3 by verylonglogin.reg — 2014-05-08T08:31:44Z
*** Issue 12439 has been marked as a duplicate of this issue. ***
Comment #4 by k.hara.pg — 2015-03-25T05:08:31Z
*** Issue 11950 has been marked as a duplicate of this issue. ***