2143 – Mixed-in identifier is not recognized by static if

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2143 - Mixed-in identifier is not recognized by static if
Summary: Mixed-in identifier is not recognized by static if
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2008年06月06日 10:55 UTC by Max Samukha
Modified: 2014年02月24日 15:32 UTC (History)
0 users

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 Max Samukha 2008年06月06日 10:55:05 UTC
May be related to 1113 and others
----
template Tuple(A...)
{
 alias A Tuple;
}
template Foo()
{
 mixin ("alias Tuple!(1) tuple;");
 
 static if (tuple[0] == 1)
 {
 }
}
alias Foo!() foo;
----
test.d(13): Error: undefined identifier tuple
Add an intermediate alias to work around it:
----
template Foo()
{
 mixin ("alias Tuple!(1) tuple;");
 
 alias tuple betterTuple; 
 static if (betterTuple[0] == 1)
 {
 }
}
----
Comment 1 Walter Bright 2008年06月22日 18:58:59 UTC
Fixed dmd 1.031 and 2.015


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