Bug 10038 – Poor error for undefined variable in template args using UFCS on UDT
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-07T09:48:00Z
Last change time
2013-11-21T08:08:39Z
Assigned to
nobody
Creator
peter.alexander.au
Comments
Comment #0 by peter.alexander.au — 2013-05-07T09:48:17Z
--------------------------------
struct S {}
int foo(alias A)(S s) { return 1; }
int baderror = S().foo!(X);
--------------------------------
Error is:
bug.d(3): Error: no property 'foo' for type 'S'
Ideally would be:
bug.d(3): Error: undefined identifier X.
This can be quite problematic in large UFCS chain expressions, like what you get when using ranges. A small typo can take quite a while to track down with the current diagnostics.
Comment #1 by bearophile_hugs — 2013-05-07T09:51:51Z
I think this is already fixed in the latest beta, it gives:
temp.d(3): Error: undefined identifier X, did you mean struct S?
Comment #2 by andrej.mitrovich — 2013-05-07T12:06:37Z
(In reply to comment #1)
> I think this is already fixed in the latest beta, it gives:
>
> temp.d(3): Error: undefined identifier X, did you mean struct S?
Yes it's a dup of some recently fixed bug, can't remember the ID though.