Bug 8245 – UFCS doesn't work for pointers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-14T12:04:00Z
Last change time
2013-04-23T02:18:49Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-06-14T12:04:01Z
cat > bug.d << CODE string toStr(immutable(char)* p) { return null; } void main() { immutable(char)* p = "foobar".ptr; p.toStr(); } CODE dmd -c bug Error: no property 'toStr' for type 'immutable(char)' ---- Property resolution is only attempted on the dereferenced value. IIUC we'd need to do 4 lookups. - intrinsic properties - properties of dereferenced value - ufcs of value - ufcs of dereferenced value (bug 8213)
Comment #1 by verylonglogin.reg — 2013-04-19T01:21:44Z
Code from description compiles fine now. But it still fails for properties: --- @property string asStr(immutable(char)* p) { return null; } void main() { immutable(char)* p = "foobar".ptr; p.asStr; // Error: no property 'asStr' for type 'immutable(char)' } ---
Comment #2 by k.hara.pg — 2013-04-19T02:18:12Z
Comment #3 by github-bugzilla — 2013-04-22T23:55:48Z