Bug 8094 – Static if matching using alias parameter in template fails

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-14T03:45:00Z
Last change time
2012-05-14T16:54:22Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
simen.kjaras

Comments

Comment #0 by simen.kjaras — 2012-05-14T03:45:33Z
template getParameters( T, alias P ) { static if ( is( T t == P!U, U... ) ) { alias U getParameters; } else { static assert( false ); } } void main( ) { alias getParameters!( Tuple!(int, string), Tuple ) args; } This asserts. Replace T t == P!U, U... with T t == Tuple!U, U..., and it works. (but of course then the intended functionality does not work)
Comment #1 by k.hara.pg — 2012-05-14T05:03:09Z
Comment #2 by github-bugzilla — 2012-05-14T16:23:49Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f61519bdae25f78fbeb355a8b732c8a54bb5cef0 fix Issue 8094 - Static if matching using alias parameter in template fails https://github.com/D-Programming-Language/dmd/commit/23bb1acdadaaa5b711974c5a144829b510d6f655 Merge pull request #948 from 9rnsr/fix8094 Issue 8094 - Static if matching using alias parameter in template fails