Skip to content

Commit d8ec461

Browse files
committed
Review response
1 parent e293c97 commit d8ec461

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

accepted/future-releases/generalized-typedef-2018/feature-specification.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ It is a compile-time error unless satisfaction of the declared bounds
9393
_B<sub>1</sub> .. B<sub>k</sub>_ implies that the right hand side is
9494
regular-bounded, and all types that occur as subterms of the right hand
9595
side are well-bounded.
96+
Any self reference in a type alias, either directly or recursively via another
97+
type alias, is a compile-time error.
9698

9799
Let `F<T1..Tn>` be a parameterized type where `F` denotes a declaration of
98100
the form
@@ -112,6 +114,16 @@ evaluated as an expression, it is subject to instantiation to bound.
112114
*This treatment of generic type aliases is again the same as it was
113115
previously, but it involves a larger set of types.*
114116

117+
*Note that type aliases introduce types and not classes. Consequently, a
118+
type alias can **not** be used in a position where a class is expected: in the
119+
`extends`, `with`, `implements`, or `on` clause of a class or mixin
120+
declaration; for a static member access; or in an instance creation
121+
expression (`new F()`, `const F<int>()`). On the other hand, it **can** be
122+
used as a type annotation, as a type argument, as part of a function type
123+
or function signature, as a type literal, in an `on` clause of a `try`
124+
statement, in a type test (`e is F`), and in a type cast (`e as F`).*
125+
126+
115127
### Dynamic Semantics
116128

117129
*The dynamic semantics relies on elaborations on the program performed
@@ -134,4 +146,4 @@ fresh type variable bound to the denoted type.
134146

135147
## Versions
136148

137-
* Nov 1st, 2018, version 0.1: Initial version of this document.
149+
* Nov 6th, 2018, version 0.1: Initial version of this document.

0 commit comments

Comments
 (0)