https://issues.dlang.org/show_bug.cgi?id=12651
Issue ID: 12651
Summary: TemplateArgsOf accepts nonsensical arguments
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P1
Component: Phobos
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
-----
import std.traits;
struct S(T)
{
}
void main()
{
// compiles, but makes no sense
pragma(msg, TemplateArgsOf!(S!int, S, float));
}
-----
I'm not sure whether this could also be a compiler bug. I'll CC kenji. The
following is the reduced test-case:
-----
alias TemplateArgsOf(alias T : Base!Args, alias Base, Args...) = Args;
struct S(T) { }
void main()
{
pragma(msg, TemplateArgsOf!(S!int, S, float)); // prints 'int'
}
-----
--