Bug 12651 – TemplateArgsOf accepts nonsensical arguments

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-26T09:07:00Z
Last change time
2014-04-27T20:26:57Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2014-04-26T09:07:14Z
----- 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' } -----
Comment #1 by k.hara.pg — 2014-04-26T17:13:02Z
Comment #2 by github-bugzilla — 2014-04-27T20:26:56Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1e78567964f36c62df83de1e050bd907a180b606 fix Issue 12651 - TemplateArgsOf accepts nonsensical arguments https://github.com/D-Programming-Language/dmd/commit/68aa8cc276c97dceab6746b629014ed3c782bbc8 Merge pull request #3502 from 9rnsr/fix12651 Issue 12651 - TemplateArgsOf accepts nonsensical arguments