Skip to content

Commit 35f0b23

Browse files
committed
.call insertion on nullable type; clean up BlindDefineSymbol
1 parent 1110c7a commit 35f0b23

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

55525552
\LMHash{}%
5553-
\BlindDefineSymbol{m_j,q}
5553+
\BlindDefineSymbol{m_j, q}%
55545554
Otherwise, $M_0$ contains more than one member signature named $n$.
55555555
Let \List{m}{1}{q} be those member signatures.
55565556

@@ -7686,7 +7686,7 @@ \subsection{Super-Bounded Types}
76867686
}
76877687

76887688
\LMHash{}%
7689-
\BlindDefineSymbol{T,T_j,s}%
7689+
\BlindDefineSymbol{T, T_j, s}%
76907690
Let $T$ be a parameterized type of the form \code{$G$<\List{T}{1}{s}>}
76917691
where $G$ denotes a generic class or a generic type alias.
76927692
$T$ is \Index{super-bounded} if{}f the following conditions are both true:
@@ -8095,7 +8095,7 @@ \subsubsection{The Instantiation to Bound Algorithm}
80958095
We now specify how the
80968096
\Index{instantiation to bound}
80978097
algorithm proceeds.
8098-
\BlindDefineSymbol{T,X_j,k,B_j,S_j}%
8098+
\BlindDefineSymbol{T, X_j, k, B_j, S_j}%
80998099
Let $T$ be a raw type.
81008100
Let \List{X}{1}{k} be the formal type parameters in the declaration of $G$,
81018101
and let \List{B}{1}{k} be their bounds.
@@ -10421,7 +10421,7 @@ \subsubsection{List Literal Inference}
1042110421
the element type of \metavar{list} as a whole.
1042210422

1042310423
\LMHash{}%
10424-
\BlindDefineSymbol{P, P_e}
10424+
\BlindDefineSymbol{P, P_e}%
1042510425
The context type $P$
1042610426
(\ref{setAndMapLiteralDisambiguation})
1042710427
for each element of \metavar{list} is
@@ -10550,7 +10550,7 @@ \subsubsection{List Literal Inference}
1055010550
\IndexCustom{type inference on a list literal}{%
1055110551
type inference!list literal}
1055210552
as a whole.
10553-
\BlindDefineSymbol{\metavar{list},\ell_j,P}%
10553+
\BlindDefineSymbol{\metavar{list}, \ell_j, P}%
1055410554
Assume that \metavar{list} is derived from \synt{listLiteral}
1055510555
and contains the elements \List{\ell}{1}{n},
1055610556
and the context type for \metavar{list} is $P$.
@@ -10785,7 +10785,7 @@ \subsubsection{Set and Map Literal Disambiguation}
1078510785
(\ref{setAndMapLiteralInference}).
1078610786

1078710787
\LMHash{}%
10788-
\BlindDefineSymbol{e,{\cal L},C}%
10788+
\BlindDefineSymbol{e, {\cal L}, C}%
1078910789
Let $e$ be a \synt{setOrMapLiteral}
1079010790
with leaf elements $\cal L$ and context type $C$.
1079110791
If $C$ is \FreeContext{} then let $S$ be undefined.
@@ -10920,7 +10920,7 @@ \subsubsection{Set and Map Literal Inference}
1092010920
\end{dartCode}
1092110921

1092210922
\LMHash{}%
10923-
\BlindDefineSymbol{\metavar{collection},P}%
10923+
\BlindDefineSymbol{\metavar{collection}, P}%
1092410924
Let \metavar{collection} be a collection literal
1092510925
derived from \synt{setOrMapLiteral}.
1092610926
The inferred type of an \synt{element} is an element type $T$,
@@ -10961,7 +10961,7 @@ \subsubsection{Set and Map Literal Inference}
1096110961
provides a partial constraint on the inferred type.%
1096210962
}
1096310963
\item
10964-
\BlindDefineSymbol{P_k,P_v}%
10964+
\BlindDefineSymbol{P_k, P_v}%
1096510965
If \metavar{collection} is unambiguously a map
1096610966
then $P$ is \code{Map<$P_k$,\,\,$P_v$>}
1096710967
where $P_k$ and $P_v$ are determined by downwards inference,
@@ -11152,7 +11152,7 @@ \subsubsection{Set and Map Literal Inference}
1115211152

1115311153
\LMHash{}%
1115411154
\Case{If element}
11155-
\BlindDefineSymbol{b,\ell_1,\ell_2}%
11155+
\BlindDefineSymbol{b, \ell_1, \ell_2}%
1115611156
In this case $\ell$ is of the form
1115711157
\code{\IF\,\,($b$)\,\,$\ell_1$} or
1115811158
\code{\IF\,\,($b$)\,\,$\ell_1$\,\,\ELSE\,\,$\ell_2$}.
@@ -11204,7 +11204,7 @@ \subsubsection{Set and Map Literal Inference}
1120411204

1120511205
\LMHash{}%
1120611206
\Case{For element}
11207-
\BlindDefineSymbol{p,\ell_1}%
11207+
\BlindDefineSymbol{p, \ell_1}%
1120811208
In this case $\ell$ is of the form
1120911209
\code{\AWAIT?\,\,\FOR\,\,($p$)\,\,$\ell_1$}
1121011210
where $p$ is derived from \synt{forLoopParts} and
@@ -11253,7 +11253,7 @@ \subsubsection{Set and Map Literal Inference}
1125311253
\IndexCustom{type inference on a set or map literal}{%
1125411254
type inference!set or map literal}
1125511255
as a whole.
11256-
\BlindDefineSymbol{\metavar{collection},P}%
11256+
\BlindDefineSymbol{\metavar{collection}, P}%
1125711257
Assume that \metavar{collection} is derived from \synt{setOrMapLiteral},
1125811258
and the context type for \metavar{collection} is $P$.
1125911259

@@ -13649,9 +13649,9 @@ \subsection{Generic Function Instantiation}
1364913649
}
1365013650

1365113651
\LMHash{}%
13652-
\BlindDefineSymbol{f,G}
13652+
\BlindDefineSymbol{f, G}
1365313653
Let $f$ be an expression whose static type $G$ is
13654-
\BlindDefineSymbol{T_0,X_j,B_j,s,p}%
13654+
\BlindDefineSymbol{T_0, X_j, B_j, s, p}%
1365513655
a generic function type of the form
1365613656
\RawFunctionType{T_0}{X}{B}{s}{\metavar{p}}
1365713657
where \code{($p$)} is derived from \synt{formalParameterList}.
@@ -14199,7 +14199,7 @@ \subsubsection{Ordinary Invocation}
1419914199
Consider a
1420014200
\IndexCustom{conditional ordinary method invocation}{%
1420114201
method invocation!conditional ordinary}
14202-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14202+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1420314203
$i$ of the form
1420414204

1420514205
\noindent
@@ -14250,7 +14250,7 @@ \subsubsection{Ordinary Invocation}
1425014250
\Case{\code{$C$.$m$<$\cdots$>($\cdots$)}}
1425114251
A \IndexCustom{static member invocation}{member invocation!static}
1425214252
$i$ is an invocation of the form
14253-
\BlindDefineSymbol{i,C,m,A_j,r,a_j,n,x_j,k}%
14253+
\BlindDefineSymbol{i, C, m, A_j, r, a_j, n, x_j, k}%
1425414254
\code{%
1425514255
$C$.$m$<\TypeArgumentListStd>(\ArgumentListStd)},
1425614256
where $C$ is a term derived from \synt{typeName}
@@ -14287,7 +14287,7 @@ \subsubsection{Ordinary Invocation}
1428714287
The static type of $i$ is as specified there.
1428814288

1428914289
\LMHash{}%
14290-
\BlindDefineSymbol{i,C,m,A_j,r,a_j,n,x_j,k}%
14290+
\BlindDefineSymbol{i, C, m, A_j, r, a_j, n, x_j, k}%
1429114291
Evaluation of a static method invocation $i$ of the form
1429214292

1429314293
\noindent
@@ -14319,7 +14319,7 @@ \subsubsection{Ordinary Invocation}
1431914319
\Case{\code{$e$.$m$<$\cdots$>($\cdots$)}}
1432014320
An \IndexCustom{unconditional ordinary method invocation}{%
1432114321
method invocation!unconditional ordinary}
14322-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14322+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1432314323
$i$ is of the form
1432414324
\code{%
1432514325
$e$.$m$<\TypeArgumentListStd>(\ArgumentListStd)},
@@ -14379,7 +14379,7 @@ \subsubsection{Ordinary Invocation}
1437914379
}).
1438014380

1438114381
\LMHash{}%
14382-
\BlindDefineSymbol{L,d,F}%
14382+
\BlindDefineSymbol{L, d, F}%
1438314383
Otherwise \code{$T$.$m$} denotes an instance member.
1438414384
Let $L$ be the library that contains $i$.
1438514385
Let $d$ be the result of method lookup for $m$ in $T$ with respect to $L$,
@@ -14507,13 +14507,13 @@ \subsubsection{Ordinary Invocation}
1450714507

1450814508
\LMHash{}%
1450914509
Evaluation of an unconditional ordinary method invocation $i$ of the form
14510-
\BlindDefineSymbol{i,e,m,A_j,r,a_j,n,x_j,k}%
14510+
\BlindDefineSymbol{i, e, m, A_j, r, a_j, n, x_j, k}%
1451114511
\code{%
1451214512
$e$.$m$<\TypeArgumentListStd>(\ArgumentListStd)}
1451314513
proceeds as follows:
1451414514

1451514515
\LMHash{}%
14516-
\BlindDefineSymbol{o,f}%
14516+
\BlindDefineSymbol{o, f}%
1451714517
First, the expression $e$ is evaluated to an object $o$.
1451814518
Let $f$ be the result of looking up
1451914519
(\ref{lookup})
@@ -14870,7 +14870,7 @@ \subsection{Property Extraction}
1487014870
\Case{Conditional}
1487114871
Consider a \IndexCustom{conditional property extraction expression}{%
1487214872
property extraction!conditional}
14873-
\BlindDefineSymbol{i,e,\id}%
14873+
\BlindDefineSymbol{i, e, \id}%
1487414874
$i$ of the form \code{$e$?.\id}.
1487514875

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

1489814898
\LMHash{}%
1489914899
\Case{Static}
14900-
\BlindDefineSymbol{i,C,\id}%
14900+
\BlindDefineSymbol{i, C, \id}%
1490114901
Let \id{} be an identifier;
1490214902
a \IndexCustom{static property extraction}{%
1490314903
property extraction!static}
@@ -14962,7 +14962,9 @@ \subsection{Property Extraction}
1496214962
(\ref{functionClosurization})
1496314963
by desugaring it to a method closurization on \CALL.
1496414964
This only occurs when it is statically known that it is a callable object,
14965-
and when the context type requires a function.%
14965+
and when the context type requires a function.
14966+
Note that the static type of $e$ can not be potentially nullable,
14967+
because no such types have a method named \CALL.%
1496614968
}
1496714969
\EndCase
1496814970

@@ -17348,7 +17350,7 @@ \subsection{Lexical Lookup}
1734817350
}
1734917351

1735017352
\LMHash{}%
17351-
\BlindDefineSymbol{n, id}%
17353+
\BlindDefineSymbol{n, \id}%
1735217354
Consider the situation where a name $n$
1735317355
has basename \id{}
1735417356
(\ref{classMemberConflicts})
@@ -19369,7 +19371,7 @@ \subsection{Return}
1936919371
to be \FutureValueTypeOf{$T$}.
1937019372

1937119373
\LMHash{}%
19372-
\BlindDefineSymbol{s,e,S,f,T}%
19374+
\BlindDefineSymbol{s, e, S, f, T}%
1937319375
Consider a return statement $s$ of the form \code{\RETURN\,\,$e$?;}.
1937419376
Let $S$ be the static type of $e$, if $e$ is present,
1937519377
let $f$ be the immediately enclosing function,
@@ -19505,7 +19507,7 @@ \subsection{Return}
1950519507
\LMHash{}%
1950619508
\Case{Synchronous non-generator functions and factory constructors}
1950719509
Let $s$ be a statement of the form \code{\RETURN\,\,$e$;}.
19508-
\BlindDefineSymbol{s,e,f}%
19510+
\BlindDefineSymbol{s, e, f}%
1950919511
Let $f$ be the immediately enclosing function,
1951019512
and consider the case where $f$ is a synchronous non-generator
1951119513
or a factory constructor.
@@ -19527,7 +19529,7 @@ \subsection{Return}
1952719529
\LMHash{}%
1952819530
\Case{Asynchronous non-generator functions}
1952919531
Let $s$ be a statement of the form \code{\RETURN\,\,$e$;}.
19530-
\BlindDefineSymbol{s,e,f,T_v}%
19532+
\BlindDefineSymbol{s, e, f, T_v}%
1953119533
Let $f$ be the immediately enclosing function,
1953219534
and consider the case where $f$ is an asynchronous non-generator
1953319535
with future value type $T_v$.
@@ -22769,7 +22771,7 @@ \subsection{Type Normalization}
2276922771

2277022772
\LMHash{}%
2277122773
The function \Index{\NormalizedTypeOfName} is then defined as follows:
22772-
\BlindDefineSymbol{T_a,T_u,T_r}%
22774+
\BlindDefineSymbol{T_a, T_u, T_r}%
2277322775
Let $T_a$ be a type
2277422776
(\commentary{where `a' stands for `argument'}).
2277522777
Let $T_u$ be the transitive alias expansion of $T_a$
@@ -22904,7 +22906,7 @@ \subsection{Least and Greatest Closure of Types}
2290422906
}
2290522907

2290622908
\LMHash{}%
22907-
\BlindDefineSymbol{S,L,X_j,n}%
22909+
\BlindDefineSymbol{S, L, X_j, n}%
2290822910
Let $S$ be a type and $L$ a set of type variables of the form
2290922911
$\{\List{X}{1}{n}\}$.
2291022912

@@ -24523,26 +24525,11 @@ \subsubsection{Const type variable elimination}
2452324525
\}
2452424526
\end{dartCode}
2452524527

24526-
\subsubsection{Implicit conversions}
24527-
24528-
!!!TODO!!!
24529-
24530-
Implicit tear-off conversion is not performed on objects of nullable type,
24531-
regardless of the context type. For example:
24532-
24533-
\begin{dartCode}
24534-
\CLASS\ C \{
24535-
int call() \{\}
24536-
\}
24537-
\VOID\ main() \{
24538-
int \FUNCTION()? c0 = \NEW\ C(); // Ok
24539-
int \FUNCTION()? c0 = (null \AS\ C?); // static error
24540-
int \FUNCTION() c1 = (null \AS\ C?); // static error
24541-
\}
24542-
\end{dartCode}
2454324528

2454424529
\subsubsection{Constant Objects}
2454524530

24531+
!!!TODO!!!
24532+
2454624533
The definition of potentially constant expressions is extended to include type
2454724534
casts and instance checks on potentially constant types, as follows.
2454824535

0 commit comments

Comments
 (0)