You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there exists a lexically visible declaration named $id$, let $f_{id}$ be the innermost such declaration. Then:
3672
3672
\begin{itemize}
3673
+
\item
3674
+
If $f_{id}$ is a prefix object, a compile-time error occurs.
3673
3675
\item
3674
3676
If $f_{id}$ is a local function, a library function, a library or static getter or a variable then $i$ is interpreted as a function expression invocation (\ref{functionExpressionInvocation}).
3675
3677
\item
3676
3678
Otherwise, if $f_{id}$ is a static method of the enclosing class $C$, $i$ is equivalent to $C.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
3677
3679
\item Otherwise, $f_{id}$ is considered equivalent to the ordinary method invocation $\THIS{}.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
3678
3680
\end{itemize}
3679
3681
3680
-
%Otherwise, if there is an accessible (\ref{privacy}) static method named $id$ declared in a superclass $S$ of the immediately enclosing class $C$ then i is equivalent to the static method invocation $S.id(a_1, \ldots, a_n, x_{n+1}: a_{n+1}, \ldots, x_{n+k}: a_{n+k})$.
3681
-
3682
-
%\rationale{
3683
-
%Unqualified access to static methods of superclasses is inconsistent with the idea that static methods are not inherited. It is not particularly necessary and may be restricted in future versions.
3684
-
%}
3685
-
3686
3682
\LMHash{}
3687
3683
Otherwise, if $i$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer, evaluation of $i$ causes a \cd{NoSuchMethodError} to be thrown.
3688
3684
3689
3685
\LMHash{}
3690
3686
If $i$ does not occur inside a top level or static function, $i$ is equivalent to $\THIS{}.id(a_1, \ldots , a_n, x_{n+1}: a_{n+1}, \ldots , x_{n+k}: a_{n+k})$.
3691
3687
3688
+
3692
3689
% Should also say:
3693
3690
% It is a static warning if $i$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer and there is no lexically visible declaration named $id$ in scope.
3694
3691
@@ -4406,6 +4403,7 @@ \subsection{ Assignment}
4406
4403
4407
4404
\LMHash{}
4408
4405
Let $d$ be the innermost declaration whose name is $v$ or $v=$, if it exists.
4406
+
It is a compile-time error if $d$ denotes a prefix object.
4409
4407
4410
4408
\LMHash{}
4411
4409
If $d$ is the declaration of a local variable, the expression $e$ is evaluated to an object $o$. Then, the variable $v$ is bound to $o$ unless $v$ is \FINAL{} or \CONST{}, in which case a dynamic error occurs.
0 commit comments