blob: d4f739621f8410bc82bc0760322c62ddc4b55689 [file] [log] [blame]
/*
* Copyright (c) 2019, 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.
*/
/**
* @assertion A check of the form [e != null] or of the form [e is T] where [e]
* has static type [T?] promotes the type of [e] to [T] in the [true]
* continuation, and to [Null] in the [false] continuation.
*
* @description Check that type of [e] is promoted to [T] in the [false]
* condition. Test [e != null] expression. Test pre-NNBD legacy types and type
* aliases
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
import "legacy_library_lib.dart";
import "legacy_library_aliases_lib.dart" as aliases;
typedef AAlias = A?;
main() {
AAlias a = new A();
if (a != null) {
a.foo();
AAlias a1 = a;
}
aliases.AAlias? a2 = aliases.A();
if (a2 != null) {
a2.bar();
aliases.AAlias a22 = a2;
}
}