|
31 | 31 | % publishing a stable version of the specification).
|
32 | 32 | % - Add rule that a top-level pair of declarations with the same basename
|
33 | 33 | % is a compile-time error except when it is a getter/setter pair.
|
| 34 | +% - Change grammar to enable non-function type aliases. Correct rule for |
| 35 | +% invoking `F.staticMethod()` where `F` is a type alias. |
34 | 36 | %
|
35 | 37 | % 2.8 - 2.10
|
36 | 38 | % - Change several warnings to compile-time errors, matching the actual
|
@@ -20117,10 +20119,9 @@ \subsection{Type Aliases}
|
20117 | 20119 | because of the prominent occurrence of the token \TYPEDEF.%
|
20118 | 20120 | }
|
20119 | 20121 |
|
20120 |
| -%%TODO(eernst): With non-function type aliases, change <functionType> to <type>. |
20121 | 20122 | \begin{grammar}
|
20122 | 20123 | <typeAlias> ::= \gnewline{}
|
20123 |
| - \TYPEDEF{} <typeIdentifier> <typeParameters>? `=' <functionType> `;' |
| 20124 | + \TYPEDEF{} <typeIdentifier> <typeParameters>? `=' <type> `;' |
20124 | 20125 | \alt \TYPEDEF{} <functionTypeAlias>
|
20125 | 20126 |
|
20126 | 20127 | <functionTypeAlias> ::= <functionPrefix> <formalParameterPart> `;'
|
@@ -20333,23 +20334,24 @@ \subsection{Type Aliases}
|
20333 | 20334 | \code{\TYPEDEF{} $F$<\TypeParametersStd> = $T$;}
|
20334 | 20335 |
|
20335 | 20336 | \noindent
|
20336 |
| -and let \DefineSymbol{U} be a parameterized type of the form |
20337 |
| -\code{$F$<\List{U}{1}{s}>} |
20338 |
| -in a scope where $F$ denotes $D$. |
20339 |
| -Assume that the transitive alias expansion of $U$ is |
20340 |
| -a type of the form $C$ or \code{$p$.$C$} |
20341 |
| -where $C$ is an identifier denoting a class or mixin, |
20342 |
| -and $p$ is an identifier denoting an import prefix, |
20343 |
| -optionally followed by \synt{typeArguments}. |
| 20337 | +and let \DefineSymbol{U} be a type of the form $F$ or \code{$p$.$F$} |
| 20338 | +in a scope where this term denotes $D$. |
| 20339 | +Assume that the transitive alias expansion of \code{$F$<\List{X}{1}{s}>} is |
| 20340 | +\BlindDefineSymbol{C, q}% |
| 20341 | +a type of the form $C$ or \code{$q$.$C$}, |
| 20342 | +optionally followed by \synt{typeArguments}, |
| 20343 | +where $q$ is an identifier denoting an import prefix, |
| 20344 | +and $C$ respectively \code{$q$.$C$} denotes a class or mixin |
| 20345 | +(\commentary{in particular, $C$ can not be a type variable}). |
20344 | 20346 | Assume that $U$ occurs in an expression $e$ of the form
|
20345 | 20347 | `\code{$U$.\id\;\metavar{args}}'
|
20346 | 20348 | where \metavar{args} is derived from \syntax{<argumentPart>?},
|
20347 | 20349 | such that \id{} is the name of
|
20348 |
| -a static member of $C$ respectively \code{$p$.$C$}. |
| 20350 | +a static member of $C$ respectively \code{$q$.$C$}. |
20349 | 20351 | The expression $e$ is then treated as
|
20350 | 20352 | `\code{$C$.\id\;\metavar{args}}'
|
20351 | 20353 | respectively
|
20352 |
| -`\code{$p$.$C$.\id\;\metavar{args}}'. |
| 20354 | +`\code{$q$.$C$.\id\;\metavar{args}}'. |
20353 | 20355 |
|
20354 | 20356 | \commentary{%
|
20355 | 20357 | This means that it is possible to use a type alias
|
|
0 commit comments