diff --git a/specification/dartLangSpec.tex b/specification/dartLangSpec.tex index 0a24bc50e6..cd836f14ae 100644 --- a/specification/dartLangSpec.tex +++ b/specification/dartLangSpec.tex @@ -31,6 +31,8 @@ % publishing a stable version of the specification). % - Add rule that a top-level pair of declarations with the same basename % is a compile-time error except when it is a getter/setter pair. +% - Change grammar to enable non-function type aliases. Correct rule for +% invoking `F.staticMethod()` where `F` is a type alias. % % 2.8 - 2.10 % - Change several warnings to compile-time errors, matching the actual @@ -20117,10 +20119,9 @@ \subsection{Type Aliases} because of the prominent occurrence of the token \TYPEDEF.% } -%%TODO(eernst): With non-function type aliases, change to . \begin{grammar} ::= \gnewline{} - \TYPEDEF{} ? `=' `;' + \TYPEDEF{} ? `=' `;' \alt \TYPEDEF{} ::= `;' @@ -20333,23 +20334,24 @@ \subsection{Type Aliases} \code{\TYPEDEF{} $F$<\TypeParametersStd> = $T$;} \noindent -and let \DefineSymbol{U} be a parameterized type of the form -\code{$F$<\List{U}{1}{s}>} -in a scope where $F$ denotes $D$. -Assume that the transitive alias expansion of $U$ is -a type of the form $C$ or \code{$p$.$C$} -where $C$ is an identifier denoting a class or mixin, -and $p$ is an identifier denoting an import prefix, -optionally followed by \synt{typeArguments}. +and let \DefineSymbol{U} be a type of the form $F$ or \code{$p$.$F$} +in a scope where this term denotes $D$. +Assume that the transitive alias expansion of \code{$F$<\List{X}{1}{s}>} is +\BlindDefineSymbol{C, q}% +a type of the form $C$ or \code{$q$.$C$}, +optionally followed by \synt{typeArguments}, +where $q$ is an identifier denoting an import prefix, +and $C$ respectively \code{$q$.$C$} denotes a class or mixin +(\commentary{in particular, $C$ can not be a type variable}). Assume that $U$ occurs in an expression $e$ of the form `\code{$U$.\id\;\metavar{args}}' where \metavar{args} is derived from \syntax{?}, such that \id{} is the name of -a static member of $C$ respectively \code{$p$.$C$}. +a static member of $C$ respectively \code{$q$.$C$}. The expression $e$ is then treated as `\code{$C$.\id\;\metavar{args}}' respectively -`\code{$p$.$C$.\id\;\metavar{args}}'. +`\code{$q$.$C$.\id\;\metavar{args}}'. \commentary{% This means that it is possible to use a type alias