Bug 10807 – Strange error message with template, __traits and property syntax
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-12T04:29:00Z
Last change time
2015-06-09T17:33:16Z
Assigned to
nobody
Creator
doob
Comments
Comment #0 by doob — 2013-08-12T04:29:14Z
The following code:
class A
{
void size () ()
{
__traits(foo);
}
}
void main ()
{
auto a = new A;
a.size;
}
Gives the following compile error:
Error: cannot resolve type for a.size()()
Error: dottd has no effect in expression (a.size()())
As far as I know "dottd" is an internal name in the compiler.
If I add a pair of parentheses to the call to "size" or if the method is not a template method the correct error message appears:
Error: unrecognized trait foo
Error: long has no effect in expression (false)
Error: template instance main.A.size!() error instantiating
Comment #1 by k.hara.pg — 2013-08-13T00:01:29Z
(In reply to comment #0)
> The following code:
>
[snip]
>
> Gives the following compile error:
>
> Error: cannot resolve type for a.size()()
> Error: dottd has no effect in expression (a.size()())
>
> As far as I know "dottd" is an internal name in the compiler.
This issue does not occur with git head (b4584d77bd).