@@ -10428,6 +10428,13 @@ \subsubsection{Lists}
10428
10428
the result of evaluating a constant expression.%
10429
10429
}
10430
10430
10431
+ \LMHash{}%
10432
+ The canonical instance of a constant list literal has a type argument
10433
+ which is transitively alias expanded
10434
+ (\ref{typedef})
10435
+ and normalized
10436
+ (\ref{typeNormalization}).
10437
+
10431
10438
\LMHash{}%
10432
10439
A run-time list literal
10433
10440
\code{<$T$>[\List{\ell}{1}{m}]}
@@ -11242,6 +11249,13 @@ \subsubsection{Sets}
11242
11249
the result of evaluating a constant expression.%
11243
11250
}
11244
11251
11252
+ \LMHash{}%
11253
+ The canonical instance of a constant set literal has a type argument
11254
+ which is transitively alias expanded
11255
+ (\ref{typedef})
11256
+ and normalized
11257
+ (\ref{typeNormalization}).
11258
+
11245
11259
\LMHash{}%
11246
11260
A run-time set literal \code{<$T$>\{\List{\ell}{1}{n}\}}
11247
11261
is evaluated as follows:
@@ -11437,6 +11451,13 @@ \subsubsection{Maps}
11437
11451
the result of evaluating a constant expression.%
11438
11452
}
11439
11453
11454
+ \LMHash{}%
11455
+ The canonical instance of a constant map literal has type arguments
11456
+ which are transitively alias expanded
11457
+ (\ref{typedef})
11458
+ and normalized
11459
+ (\ref{typeNormalization}).
11460
+
11440
11461
\LMHash{}%
11441
11462
A run-time map literal
11442
11463
\code{<$T_1, T_2$>\{\List{\ell}{1}{m}\}}
@@ -12221,6 +12242,14 @@ \subsubsection{Const}
12221
12242
The constructor need only be executed once per call site, at compile time.%
12222
12243
}
12223
12244
12245
+ \LMHash{}%
12246
+ For instances of a generic class,
12247
+ the canonical instance of a constant object expression has type arguments
12248
+ which are transitively alias expanded
12249
+ (\ref{typedef})
12250
+ and normalized
12251
+ (\ref{typeNormalization}).
12252
+
12224
12253
\LMHash{}%
12225
12254
It is a \Error{compile-time error} if evaluation of a constant object
12226
12255
results in an uncaught exception being thrown.
@@ -13294,6 +13323,14 @@ \subsection{Function Closurization}
13294
13323
are canonicalized.%
13295
13324
}
13296
13325
13326
+ \LMHash{}%
13327
+ The canonical instance of a constant function closurization has
13328
+ parameter types and a return type
13329
+ which are transitively alias expanded
13330
+ (\ref{typedef})
13331
+ and normalized
13332
+ (\ref{typeNormalization}).
13333
+
13297
13334
13298
13335
\subsection{Generic Function Instantiation}
13299
13336
\LMLabel{genericFunctionInstantiation}
@@ -24190,36 +24227,10 @@ \subsubsection{Null promotion}
24190
24227
These are extended as per
24191
24228
[separate proposal](https://github.com/dart-lang/language/blob/master/resources/type-system/flow-analysis.md).
24192
24229
24193
-
24194
24230
\paragraph{Constant instances}
24195
24231
24196
24232
!!!TODO!!!
24197
24233
24198
- Any two instances which are otherwise identical except for their
24199
- generic type arguments shall be considered identical if those generic
24200
- type arguments compare equal using the definition of runtime type
24201
- object equality defined above. That is, comparison (or
24202
- canonicalization) of constant instances of generic classes is
24203
- performed relative to the normal forms of their generic type
24204
- arguments. Hence, an instance of \code{$C$<$T_0$>} compares identical
24205
- to \code{C<$T_1$>} if $T_0$ and $T_1$ have the same normal form (up to
24206
- the identity of bound variables), and the objects are otherwise
24207
- identical.
24208
-
24209
- Implementations of the Dart runtime semantics rely on canonicalization of
24210
- constant objects to allow the identity semantics specified above to be
24211
- implemented as fast pointer equality checks on the reference to the canonical
24212
- form. The definition above defines equivalence classes of constant objects for
24213
- which we must choose the canonical representative.
24214
-
24215
- We define the choice of the canonical instance representing an
24216
- equivalence class of constant objects as follows.
24217
-
24218
- All generic constant constructors and generic constant
24219
- literals are evaluated using the type arguments provided, and canonicalization
24220
- is performed with respect to the normal form of the type arguments. This
24221
- ensures a consistent semantics, since it is not observable which instance is
24222
- chosen as the canonical representative.
24223
24234
24224
24235
\subsubsection{Null check operator}
24225
24236
0 commit comments