Skip to content

Commit f4adfda

Browse files
committed
.call insertion on nullable type; clean up BlindDefineSymbol
1 parent 3fd9ce1 commit f4adfda

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
@@ -5372,7 +5372,7 @@ \subsection{Combined Member Signatures}
53725372
the combined member signature is $m'$.
53735373

53745374
\LMHash{}%
5375-
\BlindDefineSymbol{m_j,q}
5375+
\BlindDefineSymbol{m_j, q}%
53765376
Otherwise, $M_0$ contains more than one member signature named $n$.
53775377
Let \List{m}{1}{q} be those member signatures.
53785378

@@ -7508,7 +7508,7 @@ \subsection{Super-Bounded Types}
75087508
}
75097509

75107510
\LMHash{}%
7511-
\BlindDefineSymbol{T,T_j,s}%
7511+
\BlindDefineSymbol{T, T_j, s}%
75127512
Let $T$ be a parameterized type of the form \code{$G$<\List{T}{1}{s}>}
75137513
where $G$ denotes a generic class or a generic type alias.
75147514
$T$ is \Index{super-bounded} if{}f the following conditions are both true:
@@ -7917,7 +7917,7 @@ \subsubsection{The Instantiation to Bound Algorithm}
79177917
We now specify how the
79187918
\Index{instantiation to bound}
79197919
algorithm proceeds.
7920-
\BlindDefineSymbol{T,X_j,k,B_j,S_j}%
7920+
\BlindDefineSymbol{T, X_j, k, B_j, S_j}%
79217921
Let $T$ be a raw type.
79227922
Let \List{X}{1}{k} be the formal type parameters in the declaration of $G$,
79237923
and let \List{B}{1}{k} be their bounds.
@@ -10243,7 +10243,7 @@ \subsubsection{List Literal Inference}
1024310243
the element type of \metavar{list} as a whole.
1024410244

1024510245
\LMHash{}%
10246-
\BlindDefineSymbol{P, P_e}
10246+
\BlindDefineSymbol{P, P_e}%
1024710247
The context type $P$
1024810248
(\ref{setAndMapLiteralDisambiguation})
1024910249
for each element of \metavar{list} is
@@ -10372,7 +10372,7 @@ \subsubsection{List Literal Inference}
1037210372
\IndexCustom{type inference on a list literal}{%
1037310373
type inference!list literal}
1037410374
as a whole.
10375-
\BlindDefineSymbol{\metavar{list},\ell_j,P}%
10375+
\BlindDefineSymbol{\metavar{list}, \ell_j, P}%
1037610376
Assume that \metavar{list} is derived from \synt{listLiteral}
1037710377
and contains the elements \List{\ell}{1}{n},
1037810378
and the context type for \metavar{list} is $P$.
@@ -10607,7 +10607,7 @@ \subsubsection{Set and Map Literal Disambiguation}
1060710607
(\ref{setAndMapLiteralInference}).
1060810608

1060910609
\LMHash{}%
10610-
\BlindDefineSymbol{e,{\cal L},C}%
10610+
\BlindDefineSymbol{e, {\cal L}, C}%
1061110611
Let $e$ be a \synt{setOrMapLiteral}
1061210612
with leaf elements $\cal L$ and context type $C$.
1061310613
If $C$ is \FreeContext{} then let $S$ be undefined.
@@ -10742,7 +10742,7 @@ \subsubsection{Set and Map Literal Inference}
1074210742
\end{dartCode}
1074310743

1074410744
\LMHash{}%
10745-
\BlindDefineSymbol{\metavar{collection},P}%
10745+
\BlindDefineSymbol{\metavar{collection}, P}%
1074610746
Let \metavar{collection} be a collection literal
1074710747
derived from \synt{setOrMapLiteral}.
1074810748
The inferred type of an \synt{element} is an element type $T$,
@@ -10783,7 +10783,7 @@ \subsubsection{Set and Map Literal Inference}
1078310783
provides a partial constraint on the inferred type.%
1078410784
}
1078510785
\item
10786-
\BlindDefineSymbol{P_k,P_v}%
10786+
\BlindDefineSymbol{P_k, P_v}%
1078710787
If \metavar{collection} is unambiguously a map
1078810788
then $P$ is \code{Map<$P_k$,\,\,$P_v$>}
1078910789
where $P_k$ and $P_v$ are determined by downwards inference,
@@ -10974,7 +10974,7 @@ \subsubsection{Set and Map Literal Inference}
1097410974

1097510975
\LMHash{}%
1097610976
\Case{If element}
10977-
\BlindDefineSymbol{b,\ell_1,\ell_2}%
10977+
\BlindDefineSymbol{b, \ell_1, \ell_2}%
1097810978
In this case $\ell$ is of the form
1097910979
\code{\IF\,\,($b$)\,\,$\ell_1$} or
1098010980
\code{\IF\,\,($b$)\,\,$\ell_1$\,\,\ELSE\,\,$\ell_2$}.
@@ -11026,7 +11026,7 @@ \subsubsection{Set and Map Literal Inference}
1102611026

1102711027
\LMHash{}%
1102811028
\Case{For element}
11029-
\BlindDefineSymbol{p,\ell_1}%
11029+
\BlindDefineSymbol{p, \ell_1}%
1103011030
In this case $\ell$ is of the form
1103111031
\code{\AWAIT?\,\,\FOR\,\,($p$)\,\,$\ell_1$}
1103211032
where $p$ is derived from \synt{forLoopParts} and
@@ -11075,7 +11075,7 @@ \subsubsection{Set and Map Literal Inference}
1107511075
\IndexCustom{type inference on a set or map literal}{%
1107611076
type inference!set or map literal}
1107711077
as a whole.
11078-
\BlindDefineSymbol{\metavar{collection},P}%
11078+
\BlindDefineSymbol{\metavar{collection}, P}%
1107911079
Assume that \metavar{collection} is derived from \synt{setOrMapLiteral},
1108011080
and the context type for \metavar{collection} is $P$.
1108111081

@@ -13465,9 +13465,9 @@ \subsection{Generic Function Instantiation}
1346513465
}
1346613466

1346713467
\LMHash{}%
13468-
\BlindDefineSymbol{f,G}
13468+
\BlindDefineSymbol{f, G}
1346913469
Let $f$ be an expression whose static type $G$ is
13470-
\BlindDefineSymbol{T_0,X_j,B_j,s,p}%
13470+
\BlindDefineSymbol{T_0, X_j, B_j, s, p}%
1347113471
a generic function type of the form
1347213472
\RawFunctionType{T_0}{X}{B}{s}{\metavar{p}}
1347313473
where \code{($p$)} is derived from \synt{formalParameterList}.
@@ -14015,7 +14015,7 @@ \subsubsection{Ordinary Invocation}
1401514015
Consider a
1401614016
\IndexCustom{conditional ordinary method invocation}{%
1401714017
method invocation!conditional ordinary}
14018-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14018+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1401914019
$i$ of the form
1402014020

1402114021
\noindent
@@ -14066,7 +14066,7 @@ \subsubsection{Ordinary Invocation}
1406614066
\Case{\code{$C$.$m$<$\cdots$>($\cdots$)}}
1406714067
A \IndexCustom{static member invocation}{member invocation!static}
1406814068
$i$ is an invocation of the form
14069-
\BlindDefineSymbol{i,C,m,A_j,r,a_j,n,x_j,k}%
14069+
\BlindDefineSymbol{i, C, m, A_j, r, a_j, n, x_j, k}%
1407014070
\code{%
1407114071
$C$.$m$<\TypeArgumentListStd>(\ArgumentListStd)},
1407214072
where $C$ is a term derived from \synt{typeName}
@@ -14103,7 +14103,7 @@ \subsubsection{Ordinary Invocation}
1410314103
The static type of $i$ is as specified there.
1410414104

1410514105
\LMHash{}%
14106-
\BlindDefineSymbol{i,C,m,A_j,r,a_j,n,x_j,k}%
14106+
\BlindDefineSymbol{i, C, m, A_j, r, a_j, n, x_j, k}%
1410714107
Evaluation of a static method invocation $i$ of the form
1410814108

1410914109
\noindent
@@ -14135,7 +14135,7 @@ \subsubsection{Ordinary Invocation}
1413514135
\Case{\code{$e$.$m$<$\cdots$>($\cdots$)}}
1413614136
An \IndexCustom{unconditional ordinary method invocation}{%
1413714137
method invocation!unconditional ordinary}
14138-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14138+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1413914139
$i$ is of the form
1414014140
\code{%
1414114141
$e$.$m$<\TypeArgumentListStd>(\ArgumentListStd)},
@@ -14195,7 +14195,7 @@ \subsubsection{Ordinary Invocation}
1419514195
}).
1419614196

1419714197
\LMHash{}%
14198-
\BlindDefineSymbol{L,d,F}%
14198+
\BlindDefineSymbol{L, d, F}%
1419914199
Otherwise \code{$T$.$m$} denotes an instance member.
1420014200
Let $L$ be the library that contains $i$.
1420114201
Let $d$ be the result of method lookup for $m$ in $T$ with respect to $L$,
@@ -14323,13 +14323,13 @@ \subsubsection{Ordinary Invocation}
1432314323

1432414324
\LMHash{}%
1432514325
Evaluation of an unconditional ordinary method invocation $i$ of the form
14326-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14326+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1432714327
\code{%
1432814328
$e$.$m$<\TypeArgumentListStd>(\ArgumentListStd)}
1432914329
proceeds as follows:
1433014330

1433114331
\LMHash{}%
14332-
\BlindDefineSymbol{o,f}%
14332+
\BlindDefineSymbol{o, f}%
1433314333
First, the expression $e$ is evaluated to an object $o$.
1433414334
Let $f$ be the result of looking up
1433514335
(\ref{lookup})
@@ -14686,7 +14686,7 @@ \subsection{Property Extraction}
1468614686
\Case{Conditional}
1468714687
Consider a \IndexCustom{conditional property extraction expression}{%
1468814688
property extraction!conditional}
14689-
\BlindDefineSymbol{i,e,\id}%
14689+
\BlindDefineSymbol{i, e, \id}%
1469014690
$i$ of the form \code{$e$?.\id}.
1469114691

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

1471414714
\LMHash{}%
1471514715
\Case{Static}
14716-
\BlindDefineSymbol{i,C,\id}%
14716+
\BlindDefineSymbol{i, C, \id}%
1471714717
Let \id{} be an identifier;
1471814718
a \IndexCustom{static property extraction}{%
1471914719
property extraction!static}
@@ -14778,7 +14778,9 @@ \subsection{Property Extraction}
1477814778
(\ref{functionClosurization})
1477914779
by desugaring it to a method closurization on \CALL.
1478014780
This only occurs when it is statically known that it is a callable object,
14781-
and when the context type requires a function.%
14781+
and when the context type requires a function.
14782+
Note that the static type of $e$ can not be potentially nullable,
14783+
because no such types have a method named \CALL.%
1478214784
}
1478314785
\EndCase
1478414786

@@ -17164,7 +17166,7 @@ \subsection{Lexical Lookup}
1716417166
}
1716517167

1716617168
\LMHash{}%
17167-
\BlindDefineSymbol{n, id}%
17169+
\BlindDefineSymbol{n, \id}%
1716817170
Consider the situation where a name $n$
1716917171
has basename \id{}
1717017172
(\ref{classMemberConflicts})
@@ -19133,7 +19135,7 @@ \subsection{Return}
1913319135
to be \FutureValueTypeOf{$T$}.
1913419136

1913519137
\LMHash{}%
19136-
\BlindDefineSymbol{s,e,S,f,T}%
19138+
\BlindDefineSymbol{s, e, S, f, T}%
1913719139
Consider a return statement $s$ of the form \code{\RETURN\,\,$e$?;}.
1913819140
Let $S$ be the static type of $e$, if $e$ is present,
1913919141
let $f$ be the immediately enclosing function,
@@ -19269,7 +19271,7 @@ \subsection{Return}
1926919271
\LMHash{}%
1927019272
\Case{Synchronous non-generator functions and factory constructors}
1927119273
Let $s$ be a statement of the form \code{\RETURN\,\,$e$;}.
19272-
\BlindDefineSymbol{s,e,f}%
19274+
\BlindDefineSymbol{s, e, f}%
1927319275
Let $f$ be the immediately enclosing function,
1927419276
and consider the case where $f$ is a synchronous non-generator
1927519277
or a factory constructor.
@@ -19291,7 +19293,7 @@ \subsection{Return}
1929119293
\LMHash{}%
1929219294
\Case{Asynchronous non-generator functions}
1929319295
Let $s$ be a statement of the form \code{\RETURN\,\,$e$;}.
19294-
\BlindDefineSymbol{s,e,f,T_v}%
19296+
\BlindDefineSymbol{s, e, f, T_v}%
1929519297
Let $f$ be the immediately enclosing function,
1929619298
and consider the case where $f$ is an asynchronous non-generator
1929719299
with future value type $T_v$.
@@ -22531,7 +22533,7 @@ \subsection{Type Normalization}
2253122533

2253222534
\LMHash{}%
2253322535
The function \Index{\NormalizedTypeOfName} is then defined as follows:
22534-
\BlindDefineSymbol{T_a,T_u,T_r}%
22536+
\BlindDefineSymbol{T_a, T_u, T_r}%
2253522537
Let $T_a$ be a type
2253622538
(\commentary{where `a' stands for `argument'}).
2253722539
Let $T_u$ be the transitive alias expansion of $T_a$
@@ -22666,7 +22668,7 @@ \subsection{Least and Greatest Closure of Types}
2266622668
}
2266722669

2266822670
\LMHash{}%
22669-
\BlindDefineSymbol{S,L,X_j,n}%
22671+
\BlindDefineSymbol{S, L, X_j, n}%
2267022672
Let $S$ be a type and $L$ a set of type variables of the form
2267122673
$\{\List{X}{1}{n}\}$.
2267222674

@@ -24285,26 +24287,11 @@ \subsubsection{Const type variable elimination}
2428524287
\}
2428624288
\end{dartCode}
2428724289

24288-
\subsubsection{Implicit conversions}
24289-
24290-
!!!TODO!!!
24291-
24292-
Implicit tear-off conversion is not performed on objects of nullable type,
24293-
regardless of the context type. For example:
24294-
24295-
\begin{dartCode}
24296-
\CLASS\ C \{
24297-
int call() \{\}
24298-
\}
24299-
\VOID\ main() \{
24300-
int \FUNCTION()? c0 = \NEW\ C(); // Ok
24301-
int \FUNCTION()? c0 = (null \AS\ C?); // static error
24302-
int \FUNCTION() c1 = (null \AS\ C?); // static error
24303-
\}
24304-
\end{dartCode}
2430524290

2430624291
\subsubsection{Constant Objects}
2430724292

24293+
!!!TODO!!!
24294+
2430824295
The definition of potentially constant expressions is extended to include type
2430924296
casts and instance checks on potentially constant types, as follows.
2431024297

0 commit comments

Comments
 (0)