Skip to content

Commit

Permalink
[dart2wasm] Fix nullability of type parameter types
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
osa1 authored and Commit Queue committed Dec 4, 2023
1 parent be098f0 commit 38e5af5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dart2wasm/lib/translator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class Translator with KernelNodes {
}
if (type is TypeParameterType) {
return translateStorageType(nullable
? type.bound.withDeclaredNullability(type.nullability)
? type.bound.withDeclaredNullability(Nullability.nullable)
: type.bound);
}
if (type is IntersectionType) {
Expand Down
17 changes: 17 additions & 0 deletions tests/language/extension_type/regress_53968_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// SharedOptions=--enable-experiment=inline-class

// Regression check for https://dartbug.com/53968

extension type A(int a) {}

T returnA<T extends A?>() {
return null as T;
}

void main() {
returnA();
}

0 comments on commit 38e5af5

Please sign in to comment.