www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1114] New: Indexed tuple cannot be used in inheritance declaration

reply d-bugmail puremagic.com writes:

           Summary: Indexed tuple cannot be used in inheritance declaration
           Product: D
           Version: 1.010
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: reiner.pope gmail.com

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 

Apr 08 2007
parent d-bugmail puremagic.com writes:

thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
         OS/Version|Linux                       |All

Added to DStress as

Apr 27 2007