Opened 8 years ago
Closed 8 years ago
#1 closed defect (fixed)
Self-referential generic types require forward declarations
Reported by: | Rob Schluntz | Owned by: | pabuhr |
---|---|---|---|
Priority: | major | Component: | cfa-cc |
Version: | 1.0 | Keywords: | parsing generic types forward declaration |
Cc: |
Description ¶
The parser does not recognize generic types until the ending semicolon.
forall(otype T) struct List { List(int) * x; // parsing error };
The current workaround is to forward declare generic types.
forall(otype T) struct List; forall(otype T) struct List { List(int) * x; // okay, forward declaration makes List a generic type };
Change History (2)
comment:1 Changed 8 years ago by
Owner: | set to pabuhr |
---|---|
Status: | new → assigned |
comment:2 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.