Files
sdk/tests/language_2/vm/unique_selector_test.dart
T
Ben Konyi cdc7a16d8e Migrated test block 166 to Dart 2.0.
Bug:
Change-Id: Ib21357cf328ec25c1acc58c3b37a4a7bf2910fa1
Reviewed-on: https://dart-review.googlesource.com/4612
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-09-12 19:22:08 +00:00

35 lines
715 B
Dart

// Copyright (c) 2016, 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.
import "package:expect/expect.dart";
class A {
_unique_method() => "foo";
bar() => "A";
}
class B {
noSuchMethod(invocation) => "nsm";
bar() => "B";
}
confuse(x) {
try {
throw x;
} catch (e) {
return e;
}
return null;
}
main() {
var a = confuse(new A());
Expect.equals("foo", a._unique_method());
Expect.equals("A", a.bar());
var b = confuse(new B());
Expect.equals("nsm", b._unique_method());
Expect.equals("B", b.bar()); // Don't propagate type A to b.
}