Bug 3015 – Lookup of non-member not working

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-05-20T20:24:00Z
Last change time
2015-06-09T01:27:39Z
Keywords
rejects-valid
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-05-20T20:24:15Z
This code doesn't compile: struct R { bool empty(); ref int front(); void popFront(); } ref int popNext(ref R fwdRange) { auto result = & fwdRange.front(); fwdRange.popFront; return *result; } void main() { R r; int x = r.popNext; } The code should work: popNext should be looked up in R's outer scope if not a member.
Comment #1 by gide — 2009-05-21T10:00:14Z
Added keyword, error message is as follows. C:> dmd test.d test.d(18): Error: no property 'popNext' for type 'R'
Comment #2 by georg — 2009-05-21T17:39:39Z
Invisible first paramter? Not with a one-parameter function?
Comment #3 by andrej.mitrovich — 2012-10-28T11:51:15Z
Seems to work now.