Skip to content

Commit 67b99e4

Browse files
committed
Make sure we use lexical scope consistently when dealing with prefixes.
BUG= R=lrn@google.com, paulberry@google.com Review URL: https://codereview.chromium.org//1184583002.
1 parent 82215d3 commit 67b99e4

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

docs/language/dartLangSpec.tex

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,25 +3670,22 @@ \subsubsection{ Unqualified Invocation}
36703670
\LMHash{}
36713671
If there exists a lexically visible declaration named $id$, let $f_{id}$ be the innermost such declaration. Then:
36723672
\begin{itemize}
3673+
\item
3674+
If $f_{id}$ is a prefix object, a compile-time error occurs.
36733675
\item
36743676
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}).
36753677
\item
36763678
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})$.
36773679
\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})$.
36783680
\end{itemize}
36793681

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-
36863682
\LMHash{}
36873683
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.
36883684

36893685
\LMHash{}
36903686
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})$.
36913687

3688+
36923689
% Should also say:
36933690
% 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.
36943691

@@ -4406,6 +4403,7 @@ \subsection{ Assignment}
44064403

44074404
\LMHash{}
44084405
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.
44094407

44104408
\LMHash{}
44114409
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

Comments
 (0)