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)'
}
---