46a712d925
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>
22 lines
509 B
Dart
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() {}
|