Bug 1215 – Alias of a indexed tuple's field isn't allowed
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-05-06T03:01:00Z
Last change time
2017-07-03T18:04:20Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
reiner.pope
Comments
Comment #0 by reiner.pope — 2007-05-06T03:01:30Z
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;
Comment #1 by clem — 2015-03-15T19:19:58Z
*** Issue 13883 has been marked as a duplicate of this issue. ***
Comment #2 by clem — 2015-03-15T19:22:58Z
This is not specific to alias:
template Foo(T...)
{
T[0].TheType myMember;
}
Fails as well.
Parse::parseType() just fails to realize that this is a type.