8f52be2282
Also fix the type inference algorithm so that when it explores multiple alternatives (as a result of the use of FutureOr<>), if one alternative generated some constraints but failed to produce a match, it rewinds those constraints and tries the other alternative. (Previously, it erroneously assumed that if any constraints were generated, the alternative matched successfully). Also add unit tests to verify the proper operation of the subtype match algorithm. Fixes #32305. Change-Id: I060b5d6d5247a68d2b27bba78819bae172e43d97 Reviewed-on: https://dart-review.googlesource.com/53685 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Jenny Messerly <jmesserly@google.com>
11 lines
328 B
Dart
11 lines
328 B
Dart
// Copyright (c) 2018, 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.
|
|
|
|
void main() {
|
|
int Function(int) f;
|
|
|
|
List<num> l = [];
|
|
/*@compile-error=unspecified*/ var a = l.map(f);
|
|
}
|