D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1944 - is-expressions don't correctly define tuples named in the match expression
Summary: is-expressions don't correctly define tuples named in the match expression
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2008-03-25 16:34 UTC by Russ Lewis
Modified: 2015-06-09 01:14 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Russ Lewis 2008-03-25 16:34:21 UTC
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 Don 2012-11-12 07:33:40 UTC
Works now, probably fixed years ago.