Files
sdk/pkg/front_end/testcases/nnbd/issue43716b.dart
T
Dmitry Stefantsov 46a712d925 [cfe] Add tests for #43716
Bug: https://github.com/dart-lang/sdk/issues/43716
Change-Id: Ie5d664af306870efdde5cd63512af42e206c1dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166842
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-09 14:35:56 +00:00

22 lines
509 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.
bool b = true;
void f(Object o) {}
class C<X extends void Function(X)?> {
X x;
C(this.x);
void m() {
// UP(X extends void Function(X)?, void Function(Object)) ==
// void Function(Object)?.
var z = b ? x : f;
if (z == null) return;
z(42); // Error.
}
}
main() {}