Bug 1944 – is-expressions don't correctly define tuples named in the match expression

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-03-25T16:34:00Z
Last change time
2015-06-09T01:14:38Z
Keywords
rejects-valid
Assigned to
nobody
Creator
webmaster

Comments

Comment #0 by webmaster — 2008-03-25T16:34:21Z
dmd 2.012 The following code should compile just fine. Instead, the 2nd static assert() fails. BEGIN CODE template foo(TPL...) { static if( is(typeof(&TPL[0]) Tignored1 == void function(T), T) ) static assert(is(T == int)); static if( is(typeof(&TPL[0]) Tignored2 == void function(ARGS), ARGS...) ) static assert(ARGS.length > 0); } void bar(int i) {}; alias foo!(bar) baz; END CODE
Comment #1 by clugdbug — 2012-11-12T07:33:40Z
Works now, probably fixed years ago.