Skip to content

Commit bd5cd8a

Browse files
committed
Version 2.14.0-188.3.beta
* Cherry-pick 303f96d to beta * Cherry-pick 4c1a153 to beta
2 parents d2354ee + dd86922 commit bd5cd8a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

pkg/dev_compiler/lib/src/kernel/compiler.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,6 +2792,20 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
27922792
// FutureOr<T?>? --> FutureOr<T?>
27932793
return futureOr.withDeclaredNullability(Nullability.nonNullable);
27942794
}
2795+
// The following is not part of the normalization spec but this is a
2796+
// convenient place to perform this change of nullability consistently. This
2797+
// only applies at compile-time and is not needed in the runtime version of
2798+
// the FutureOr normalization.
2799+
// FutureOr<T%>% --> FutureOr<T%>
2800+
//
2801+
// If the type argument has undetermined nullability the CFE propagates
2802+
// it to the FutureOr type as well. In this case we can represent the
2803+
// FutureOr type without any nullability wrappers and rely on the runtime to
2804+
// handle the nullability of the instantiated type appropriately.
2805+
if (futureOr.nullability == Nullability.undetermined &&
2806+
typeArgument.nullability == Nullability.undetermined) {
2807+
return futureOr.withDeclaredNullability(Nullability.nonNullable);
2808+
}
27952809
return futureOr;
27962810
}
27972811

pkg/front_end/lib/src/fasta/source/source_library_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3577,7 +3577,7 @@ class SourceLibraryBuilder extends LibraryBuilderImpl {
35773577
// limitation of Kernel.
35783578
if (typeParameter != null &&
35793579
typeParameter.fileOffset != -1 &&
3580-
typeParameter.parent != null) {
3580+
typeParameter.location != null) {
35813581
// It looks like when parameters come from patch files, they don't
35823582
// have a reportable location.
35833583
(context ??= <LocatedMessage>[]).add(

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ MAJOR 2
2828
MINOR 14
2929
PATCH 0
3030
PRERELEASE 188
31-
PRERELEASE_PATCH 1
31+
PRERELEASE_PATCH 3

0 commit comments

Comments
 (0)