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)