[Issue 1215] New: Alias of a indexed tuple's field isn't allowed
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun May 6 01:01:31 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1215
Summary: Alias of a indexed tuple's field isn't allowed
Product: D
Version: 1.014
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: reiner.pope at gmail.com
The following code doesn't compile:
template Foo(T...)
{
alias T[0].TheType MyType;
// Above gives error:
// alias.d(3): no identifier for declarator T[0]
// alias.d(3): semicolon expected to close alias declaration
}
struct Bar
{
alias int TheType;
}
alias Foo!(Bar) FooInstance;
But replacing the alias in line 3 with the following code fixes it:
alias T[0] TheElem;
alias TheElem.TheType MyType;
--
More information about the Digitalmars-d-bugs
mailing list