Skip to content

Commit a39f020

Browse files
committed
.call insertion on nullable type; clean up BlindDefineSymbol
1 parent bb3d176 commit a39f020

File tree

1 file changed

+33
-46
lines changed

1 file changed

+33
-46
lines changed

specification/dartLangSpec.tex

Lines changed: 33 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5325,7 +5325,7 @@ \subsection{Combined Member Signatures}
53255325
the combined member signature is $m'$.
53265326

53275327
\LMHash{}%
5328-
\BlindDefineSymbol{m_j,q}
5328+
\BlindDefineSymbol{m_j, q}%
53295329
Otherwise, $M_0$ contains more than one member signature named $n$.
53305330
Let \List{m}{1}{q} be those member signatures.
53315331

@@ -7461,7 +7461,7 @@ \subsection{Super-Bounded Types}
74617461
}
74627462

74637463
\LMHash{}%
7464-
\BlindDefineSymbol{T,T_j,s}%
7464+
\BlindDefineSymbol{T, T_j, s}%
74657465
Let $T$ be a parameterized type of the form \code{$G$<\List{T}{1}{s}>}
74667466
where $G$ denotes a generic class or a generic type alias.
74677467
$T$ is \Index{super-bounded} if{}f the following conditions are both true:
@@ -7870,7 +7870,7 @@ \subsubsection{The Instantiation to Bound Algorithm}
78707870
We now specify how the
78717871
\Index{instantiation to bound}
78727872
algorithm proceeds.
7873-
\BlindDefineSymbol{T,X_j,k,B_j,S_j}%
7873+
\BlindDefineSymbol{T, X_j, k, B_j, S_j}%
78747874
Let $T$ be a raw type.
78757875
Let \List{X}{1}{k} be the formal type parameters in the declaration of $G$,
78767876
and let \List{B}{1}{k} be their bounds.
@@ -10175,7 +10175,7 @@ \subsubsection{List Literal Inference}
1017510175
the element type of \metavar{list} as a whole.
1017610176

1017710177
\LMHash{}%
10178-
\BlindDefineSymbol{P, P_e}
10178+
\BlindDefineSymbol{P, P_e}%
1017910179
The context type $P$
1018010180
(\ref{setAndMapLiteralDisambiguation})
1018110181
for each element of \metavar{list} is
@@ -10304,7 +10304,7 @@ \subsubsection{List Literal Inference}
1030410304
\IndexCustom{type inference on a list literal}{%
1030510305
type inference!list literal}
1030610306
as a whole.
10307-
\BlindDefineSymbol{\metavar{list},\ell_j,P}%
10307+
\BlindDefineSymbol{\metavar{list}, \ell_j, P}%
1030810308
Assume that \metavar{list} is derived from \synt{listLiteral}
1030910309
and contains the elements \List{\ell}{1}{n},
1031010310
and the context type for \metavar{list} is $P$.
@@ -10539,7 +10539,7 @@ \subsubsection{Set and Map Literal Disambiguation}
1053910539
(\ref{setAndMapLiteralInference}).
1054010540

1054110541
\LMHash{}%
10542-
\BlindDefineSymbol{e,{\cal L},C}%
10542+
\BlindDefineSymbol{e, {\cal L}, C}%
1054310543
Let $e$ be a \synt{setOrMapLiteral}
1054410544
with leaf elements $\cal L$ and context type $C$.
1054510545
If $C$ is \FreeContext{} then let $S$ be undefined.
@@ -10674,7 +10674,7 @@ \subsubsection{Set and Map Literal Inference}
1067410674
\end{dartCode}
1067510675

1067610676
\LMHash{}%
10677-
\BlindDefineSymbol{\metavar{collection},P}%
10677+
\BlindDefineSymbol{\metavar{collection}, P}%
1067810678
Let \metavar{collection} be a collection literal
1067910679
derived from \synt{setOrMapLiteral}.
1068010680
The inferred type of an \synt{element} is an element type $T$,
@@ -10715,7 +10715,7 @@ \subsubsection{Set and Map Literal Inference}
1071510715
provides a partial constraint on the inferred type.%
1071610716
}
1071710717
\item
10718-
\BlindDefineSymbol{P_k,P_v}%
10718+
\BlindDefineSymbol{P_k, P_v}%
1071910719
If \metavar{collection} is unambiguously a map
1072010720
then $P$ is \code{Map<$P_k$,\,\,$P_v$>}
1072110721
where $P_k$ and $P_v$ are determined by downwards inference,
@@ -10906,7 +10906,7 @@ \subsubsection{Set and Map Literal Inference}
1090610906

1090710907
\LMHash{}%
1090810908
\Case{If element}
10909-
\BlindDefineSymbol{b,\ell_1,\ell_2}%
10909+
\BlindDefineSymbol{b, \ell_1, \ell_2}%
1091010910
In this case $\ell$ is of the form
1091110911
\code{\IF\,\,($b$)\,\,$\ell_1$} or
1091210912
\code{\IF\,\,($b$)\,\,$\ell_1$\,\,\ELSE\,\,$\ell_2$}.
@@ -10958,7 +10958,7 @@ \subsubsection{Set and Map Literal Inference}
1095810958

1095910959
\LMHash{}%
1096010960
\Case{For element}
10961-
\BlindDefineSymbol{p,\ell_1}%
10961+
\BlindDefineSymbol{p, \ell_1}%
1096210962
In this case $\ell$ is of the form
1096310963
\code{\AWAIT?\,\,\FOR\,\,($p$)\,\,$\ell_1$}
1096410964
where $p$ is derived from \synt{forLoopParts} and
@@ -11007,7 +11007,7 @@ \subsubsection{Set and Map Literal Inference}
1100711007
\IndexCustom{type inference on a set or map literal}{%
1100811008
type inference!set or map literal}
1100911009
as a whole.
11010-
\BlindDefineSymbol{\metavar{collection},P}%
11010+
\BlindDefineSymbol{\metavar{collection}, P}%
1101111011
Assume that \metavar{collection} is derived from \synt{setOrMapLiteral},
1101211012
and the context type for \metavar{collection} is $P$.
1101311013

@@ -13365,9 +13365,9 @@ \subsection{Generic Function Instantiation}
1336513365
}
1336613366

1336713367
\LMHash{}%
13368-
\BlindDefineSymbol{f,G}
13368+
\BlindDefineSymbol{f, G}
1336913369
Let $f$ be an expression whose static type $G$ is
13370-
\BlindDefineSymbol{T_0,X_j,B_j,s,p}%
13370+
\BlindDefineSymbol{T_0, X_j, B_j, s, p}%
1337113371
a generic function type of the form
1337213372
\RawFunctionType{T_0}{X}{B}{s}{\metavar{p}}
1337313373
where \code{($p$)} is derived from \synt{formalParameterList}.
@@ -13915,7 +13915,7 @@ \subsubsection{Ordinary Invocation}
1391513915
Consider a
1391613916
\IndexCustom{conditional ordinary method invocation}{%
1391713917
method invocation!conditional ordinary}
13918-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
13918+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1391913919
$i$ of the form
1392013920

1392113921
\noindent
@@ -13966,7 +13966,7 @@ \subsubsection{Ordinary Invocation}
1396613966
\Case{\code{$C$.$m$<$\cdots$>($\cdots$)}}
1396713967
A \IndexCustom{static member invocation}{member invocation!static}
1396813968
$i$ is an invocation of the form
13969-
\BlindDefineSymbol{i,C,m,A_j,r,a_j,n,x_j,k}%
13969+
\BlindDefineSymbol{i, C, m, A_j, r, a_j, n, x_j, k}%
1397013970
\code{%
1397113971
$C$.$m$<\TypeArgumentListStd>(\ArgumentListStd)},
1397213972
where $C$ is a term derived from \synt{typeName}
@@ -14003,7 +14003,7 @@ \subsubsection{Ordinary Invocation}
1400314003
The static type of $i$ is as specified there.
1400414004

1400514005
\LMHash{}%
14006-
\BlindDefineSymbol{i,C,m,A_j,r,a_j,n,x_j,k}%
14006+
\BlindDefineSymbol{i, C, m, A_j, r, a_j, n, x_j, k}%
1400714007
Evaluation of a static method invocation $i$ of the form
1400814008

1400914009
\noindent
@@ -14035,7 +14035,7 @@ \subsubsection{Ordinary Invocation}
1403514035
\Case{\code{$e$.$m$<$\cdots$>($\cdots$)}}
1403614036
An \IndexCustom{unconditional ordinary method invocation}{%
1403714037
method invocation!unconditional ordinary}
14038-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14038+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1403914039
$i$ is of the form
1404014040
\code{%
1404114041
$e$.$m$<\TypeArgumentListStd>(\ArgumentListStd)},
@@ -14095,7 +14095,7 @@ \subsubsection{Ordinary Invocation}
1409514095
}).
1409614096

1409714097
\LMHash{}%
14098-
\BlindDefineSymbol{L,d,F}%
14098+
\BlindDefineSymbol{L, d, F}%
1409914099
Otherwise \code{$T$.$m$} denotes an instance member.
1410014100
Let $L$ be the library that contains $i$.
1410114101
Let $d$ be the result of method lookup for $m$ in $T$ with respect to $L$,
@@ -14165,13 +14165,13 @@ \subsubsection{Ordinary Invocation}
1416514165

1416614166
\LMHash{}%
1416714167
Evaluation of an unconditional ordinary method invocation $i$ of the form
14168-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14168+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1416914169
\code{%
1417014170
$e$.$m$<\TypeArgumentListStd>(\ArgumentListStd)}
1417114171
proceeds as follows:
1417214172

1417314173
\LMHash{}%
14174-
\BlindDefineSymbol{o,f}%
14174+
\BlindDefineSymbol{o, f}%
1417514175
First, the expression $e$ is evaluated to an object $o$.
1417614176
Let $f$ be the result of looking up
1417714177
(\ref{lookup})
@@ -14528,7 +14528,7 @@ \subsection{Property Extraction}
1452814528
\Case{Conditional}
1452914529
Consider a \IndexCustom{conditional property extraction expression}{%
1453014530
property extraction!conditional}
14531-
\BlindDefineSymbol{i,e,\id}%
14531+
\BlindDefineSymbol{i, e, \id}%
1453214532
$i$ of the form \code{$e$?.\id}.
1453314533

1453414534
%% TODO(eernst): We are likely to decide that this is an error.
@@ -14555,7 +14555,7 @@ \subsection{Property Extraction}
1455514555

1455614556
\LMHash{}%
1455714557
\Case{Static}
14558-
\BlindDefineSymbol{i,C,\id}%
14558+
\BlindDefineSymbol{i, C, \id}%
1455914559
Let \id{} be an identifier;
1456014560
a \IndexCustom{static property extraction}{%
1456114561
property extraction!static}
@@ -14620,7 +14620,9 @@ \subsection{Property Extraction}
1462014620
(\ref{functionClosurization})
1462114621
by desugaring it to a method closurization on \CALL.
1462214622
This only occurs when it is statically known that it is a callable object,
14623-
and when the context type requires a function.%
14623+
and when the context type requires a function.
14624+
Note that the static type of $e$ can not be potentially nullable,
14625+
because no such types have a method named \CALL.%
1462414626
}
1462514627
\EndCase
1462614628

@@ -16935,7 +16937,7 @@ \subsection{Lexical Lookup}
1693516937
}
1693616938

1693716939
\LMHash{}%
16938-
\BlindDefineSymbol{n, id}%
16940+
\BlindDefineSymbol{n, \id}%
1693916941
Consider the situation where a name $n$
1694016942
has basename \id{}
1694116943
(\ref{classMemberConflicts})
@@ -18884,7 +18886,7 @@ \subsection{Return}
1888418886
to be \FutureValueTypeOf{$T$}.
1888518887

1888618888
\LMHash{}%
18887-
\BlindDefineSymbol{s,e,S,f,T}%
18889+
\BlindDefineSymbol{s, e, S, f, T}%
1888818890
Consider a return statement $s$ of the form \code{\RETURN\,\,$e$?;}.
1888918891
Let $S$ be the static type of $e$, if $e$ is present,
1889018892
let $f$ be the immediately enclosing function,
@@ -19020,7 +19022,7 @@ \subsection{Return}
1902019022
\LMHash{}%
1902119023
\Case{Synchronous non-generator functions and factory constructors}
1902219024
Let $s$ be a statement of the form \code{\RETURN\,\,$e$;}.
19023-
\BlindDefineSymbol{s,e,f}%
19025+
\BlindDefineSymbol{s, e, f}%
1902419026
Let $f$ be the immediately enclosing function,
1902519027
and consider the case where $f$ is a synchronous non-generator
1902619028
or a factory constructor.
@@ -19042,7 +19044,7 @@ \subsection{Return}
1904219044
\LMHash{}%
1904319045
\Case{Asynchronous non-generator functions}
1904419046
Let $s$ be a statement of the form \code{\RETURN\,\,$e$;}.
19045-
\BlindDefineSymbol{s,e,f,T_v}%
19047+
\BlindDefineSymbol{s, e, f, T_v}%
1904619048
Let $f$ be the immediately enclosing function,
1904719049
and consider the case where $f$ is an asynchronous non-generator
1904819050
with future value type $T_v$.
@@ -22266,7 +22268,7 @@ \subsection{Type Normalization}
2226622268

2226722269
\LMHash{}%
2226822270
The function \Index{\NormalizedTypeOfName} is then defined as follows:
22269-
\BlindDefineSymbol{T_a,T_u,T_r}%
22271+
\BlindDefineSymbol{T_a, T_u, T_r}%
2227022272
Let $T_a$ be a type
2227122273
(\commentary{where `a' stands for `argument'}).
2227222274
Let $T_u$ be the transitive alias expansion of $T_a$
@@ -22401,7 +22403,7 @@ \subsection{Least and Greatest Closure of Types}
2240122403
}
2240222404

2240322405
\LMHash{}%
22404-
\BlindDefineSymbol{S,L,X_j,n}%
22406+
\BlindDefineSymbol{S, L, X_j, n}%
2240522407
Let $S$ be a type and $L$ a set of type variables of the form
2240622408
$\{\List{X}{1}{n}\}$.
2240722409

@@ -24019,26 +24021,11 @@ \subsubsection{Const type variable elimination}
2401924021
\}
2402024022
\end{dartCode}
2402124023

24022-
\subsubsection{Implicit conversions}
24023-
24024-
!!!TODO!!!
24025-
24026-
Implicit tear-off conversion is not performed on objects of nullable type,
24027-
regardless of the context type. For example:
24028-
24029-
\begin{dartCode}
24030-
\CLASS\ C \{
24031-
int call() \{\}
24032-
\}
24033-
\VOID\ main() \{
24034-
int \FUNCTION()? c0 = \NEW\ C(); // Ok
24035-
int \FUNCTION()? c0 = (null \AS\ C?); // static error
24036-
int \FUNCTION() c1 = (null \AS\ C?); // static error
24037-
\}
24038-
\end{dartCode}
2403924024

2404024025
\subsubsection{Constant Objects}
2404124026

24027+
!!!TODO!!!
24028+
2404224029
The definition of potentially constant expressions is extended to include type
2404324030
casts and instance checks on potentially constant types, as follows.
2404424031

0 commit comments

Comments
 (0)