Bug 1114 – Indexed tuple cannot be used in inheritance declaration
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-04-08T19:31:56Z
Last change time
2019-07-10T12:58:22Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Reiner Pope
Comments
Comment #0 by reiner.pope — 2007-04-08T19:31:56Z
You can't use [ or ] in when declaring a base class:
template Tuple(T...)
{
alias T Tuple;
}
class Foo {}
alias Tuple!(Foo) MyTup;
class Bar
: MyTup[0] // Fails here
{}
inherittuple.d(11): members expected
inherittuple.d(11): { } expected following aggregate declaration
inherittuple.d(11): Declaration expected, not '['
It's not too big an issue, since you can replace it with
alias MyTup[0] TheBaseClass;
class Bar
: TheBaseClass
{}