8094 – Static if matching using alias parameter in template fails

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8094 - Static if matching using alias parameter in template fails
Summary: Static if matching using alias parameter in template fails
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
Reported: 2012年05月14日 03:45 UTC by Simen Kjaeraas
Modified: 2012年05月14日 16:54 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Simen Kjaeraas 2012年05月14日 03:45:33 UTC
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 Kenji Hara 2012年05月14日 05:03:09 UTC
https://github.com/D-Programming-Language/dmd/pull/948 
Comment 2 github-bugzilla 2012年05月14日 16:23:49 UTC
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


AltStyle によって変換されたページ (->オリジナル) /