Index: tests/language/vm/unique_selector_test.dart |
diff --git a/tests/language/vm/unique_selector_test.dart b/tests/language/vm/unique_selector_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e26d4b53e8a35735cd10b7633a7f48320ba8178c |
--- /dev/null |
+++ b/tests/language/vm/unique_selector_test.dart |
@@ -0,0 +1,34 @@ |
+// 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. |
+} |