@@ -10498,6 +10498,13 @@ \subsubsection{Lists}
10498
10498
the result of evaluating a constant expression.%
10499
10499
}
10500
10500
10501
+ \LMHash{}%
10502
+ The canonical instance of a constant list literal has a type argument
10503
+ which is transitively alias expanded
10504
+ (\ref{typedef})
10505
+ and normalized
10506
+ (\ref{typeNormalization}).
10507
+
10501
10508
\LMHash{}%
10502
10509
A run-time list literal
10503
10510
\code{<$T$>[\List{\ell}{1}{m}]}
@@ -11312,6 +11319,13 @@ \subsubsection{Sets}
11312
11319
the result of evaluating a constant expression.%
11313
11320
}
11314
11321
11322
+ \LMHash{}%
11323
+ The canonical instance of a constant set literal has a type argument
11324
+ which is transitively alias expanded
11325
+ (\ref{typedef})
11326
+ and normalized
11327
+ (\ref{typeNormalization}).
11328
+
11315
11329
\LMHash{}%
11316
11330
A run-time set literal \code{<$T$>\{\List{\ell}{1}{n}\}}
11317
11331
is evaluated as follows:
@@ -11507,6 +11521,13 @@ \subsubsection{Maps}
11507
11521
the result of evaluating a constant expression.%
11508
11522
}
11509
11523
11524
+ \LMHash{}%
11525
+ The canonical instance of a constant map literal has type arguments
11526
+ which are transitively alias expanded
11527
+ (\ref{typedef})
11528
+ and normalized
11529
+ (\ref{typeNormalization}).
11530
+
11510
11531
\LMHash{}%
11511
11532
A run-time map literal
11512
11533
\code{<$T_1, T_2$>\{\List{\ell}{1}{m}\}}
@@ -12320,6 +12341,14 @@ \subsubsection{Const}
12320
12341
The constructor need only be executed once per call site, at compile time.%
12321
12342
}
12322
12343
12344
+ \LMHash{}%
12345
+ For instances of a generic class,
12346
+ the canonical instance of a constant object expression has type arguments
12347
+ which are transitively alias expanded
12348
+ (\ref{typedef})
12349
+ and normalized
12350
+ (\ref{typeNormalization}).
12351
+
12323
12352
\LMHash{}%
12324
12353
It is a \Error{compile-time error} if evaluation of a constant object
12325
12354
results in an uncaught exception being thrown.
@@ -13396,6 +13425,14 @@ \subsection{Function Closurization}
13396
13425
are canonicalized.%
13397
13426
}
13398
13427
13428
+ \LMHash{}%
13429
+ The canonical instance of a constant function closurization has
13430
+ parameter types and a return type
13431
+ which are transitively alias expanded
13432
+ (\ref{typedef})
13433
+ and normalized
13434
+ (\ref{typeNormalization}).
13435
+
13399
13436
13400
13437
\subsection{Generic Function Instantiation}
13401
13438
\LMLabel{genericFunctionInstantiation}
@@ -24458,36 +24495,10 @@ \subsubsection{Null promotion}
24458
24495
These are extended as per
24459
24496
[separate proposal](https://github.com/dart-lang/language/blob/master/resources/type-system/flow-analysis.md).
24460
24497
24461
-
24462
24498
\paragraph{Constant instances}
24463
24499
24464
24500
!!!TODO!!!
24465
24501
24466
- Any two instances which are otherwise identical except for their
24467
- generic type arguments shall be considered identical if those generic
24468
- type arguments compare equal using the definition of runtime type
24469
- object equality defined above. That is, comparison (or
24470
- canonicalization) of constant instances of generic classes is
24471
- performed relative to the normal forms of their generic type
24472
- arguments. Hence, an instance of \code{$C$<$T_0$>} compares identical
24473
- to \code{C<$T_1$>} if $T_0$ and $T_1$ have the same normal form (up to
24474
- the identity of bound variables), and the objects are otherwise
24475
- identical.
24476
-
24477
- Implementations of the Dart runtime semantics rely on canonicalization of
24478
- constant objects to allow the identity semantics specified above to be
24479
- implemented as fast pointer equality checks on the reference to the canonical
24480
- form. The definition above defines equivalence classes of constant objects for
24481
- which we must choose the canonical representative.
24482
-
24483
- We define the choice of the canonical instance representing an
24484
- equivalence class of constant objects as follows.
24485
-
24486
- All generic constant constructors and generic constant
24487
- literals are evaluated using the type arguments provided, and canonicalization
24488
- is performed with respect to the normal form of the type arguments. This
24489
- ensures a consistent semantics, since it is not observable which instance is
24490
- chosen as the canonical representative.
24491
24502
24492
24503
\subsubsection{Null check operator}
24493
24504
0 commit comments