Files
sdk/pkg/front_end/testcases/nnbd_mixed/issue42836_lib.dart
T
Johnni Winther 8e7e400a00 [cfe] Use legacy erasure in LUB computation in opt-out libraries
Closes #42836

Change-Id: Ibe6d8e54e082ffb204ccc18f438809c7776c1cd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156001
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-29 07:36:34 +00:00

27 lines
916 B
Dart

// Copyright (c) 2020, 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 'issue42836.dart';
class Generic<T> {}
class NonNullable extends Generic<int> {}
class Nullable extends Generic<int?> {}
var nonNullableInstance = NonNullable();
var nullableInstance = Nullable();
test(bool b) {
var a1 = b ? legacyInstance : legacyInstance;
var a2 = b ? legacyInstance : nonNullableInstance;
var a3 = b ? legacyInstance : nullableInstance;
var b1 = b ? nonNullableInstance : legacyInstance;
var b2 = b ? nonNullableInstance : nonNullableInstance;
var b3 = b ? nonNullableInstance : nullableInstance;
var c1 = b ? nullableInstance : legacyInstance;
var c2 = b ? nullableInstance : nonNullableInstance;
var c3 = b ? nullableInstance : nullableInstance;
}