dart-sdk/tests/language/type/intersection_test.dart
Robert Nystrom 6e988a6d26 Migrate language_2/type to NNBD.
Change-Id: I39fc62d6eab731f6defe2a1c11eb21c1ba7ed072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151627
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-06-17 23:01:01 +00:00

21 lines
622 B
Dart

// Copyright (c) 2013, 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.
// Regression test for dart2js that used to consider that the
// intersection of [Comparable] and [num] is conflicting.
import "package:expect/expect.dart";
class A {
foo(a, Comparable b) => a == b;
bar(a, Comparable b) => b == a;
}
main() {
Expect.isFalse(new A().foo(1, 'foo'));
Expect.isTrue(new A().foo(1, 1));
Expect.isFalse(new A().bar(1, 'foo'));
Expect.isTrue(new A().bar(1, 1));
}