blob: 854d6823960f1abfe3a5e16c544c84ea1171491c [file] [log] [blame]
// Copyright (c) 2024, 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.
import 'package:expect/expect.dart';
// Ensure we don't omit as checks based on a subtype check ignoring nullability.
void foo<T>(T? x) {
print(x as T);
}
void main() {
if (hasSoundNullSafety) {
Expect.throws(() => foo<int>(null));
}
}