Skip to content

Commit 38e5af5

Browse files
osa1Commit Queue
authored and
Commit Queue
committed
[dart2wasm] Fix nullability of type parameter types
Fixes #53968 Change-Id: I3d4d0ff2d0fc9b196322f967600bf392124a75de Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339400 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Ömer Ağacan <[email protected]>
1 parent be098f0 commit 38e5af5

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

pkg/dart2wasm/lib/translator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ class Translator with KernelNodes {
570570
}
571571
if (type is TypeParameterType) {
572572
return translateStorageType(nullable
573-
? type.bound.withDeclaredNullability(type.nullability)
573+
? type.bound.withDeclaredNullability(Nullability.nullable)
574574
: type.bound);
575575
}
576576
if (type is IntersectionType) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// SharedOptions=--enable-experiment=inline-class
6+
7+
// Regression check for https://dartbug.com/53968
8+
9+
extension type A(int a) {}
10+
11+
T returnA<T extends A?>() {
12+
return null as T;
13+
}
14+
15+
void main() {
16+
returnA();
17+
}

0 commit comments

Comments
 (0)