Index: pkg/front_end/testcases/inference/infer_assign_to_index_set_vs_get.dart |
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_set_vs_get.dart b/pkg/front_end/testcases/inference/infer_assign_to_index_set_vs_get.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3a1f0b614e3ef9e2f5d3dc11f07ce97c3a0811ec |
--- /dev/null |
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_set_vs_get.dart |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 2017, 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. |
+ |
+/*@testedFeatures=inference*/ |
+library test; |
+ |
+class Index {} |
+ |
+class A { |
+ C operator +(F v) => null; |
+ C operator -(int i) => null; |
+} |
+ |
+class B extends A { |
+ D operator +(E v) => null; |
+ D operator -(int i) => null; |
+} |
+ |
+class C extends B {} |
+ |
+class D extends C {} |
+ |
+class E extends D {} |
+ |
+class F extends E {} |
+ |
+T f<T>() => null; |
+ |
+class Test { |
+ B operator [](Index i) => null; |
+ void operator []=(Index i, A v) {} |
+ |
+ void test() { |
+ Test t = /*@typeArgs=Test*/ f(); |
+ t /*@target=Test::[]=*/ [/*@typeArgs=dynamic*/ f()] = /*@typeArgs=A*/ f(); |
+ t /*@target=Test::[]=*/ [/*@typeArgs=dynamic*/ f()] ??= /*@typeArgs=A*/ f(); |
+ t /*@target=Test::[]=*/ [ |
+ /*@typeArgs=dynamic*/ f()] += /*@typeArgs=dynamic*/ f(); |
+ --t /*@target=Test::[]=*/ [/*@typeArgs=dynamic*/ f()]; |
+ t /*@target=Test::[]=*/ [/*@typeArgs=dynamic*/ f()]--; |
+ var /*@type=A*/ v1 = t /*@target=Test::[]=*/ [ |
+ /*@typeArgs=dynamic*/ f()] = /*@typeArgs=A*/ f(); |
+ var /*@type=A*/ v2 = t /*@target=Test::[]=*/ [ |
+ /*@typeArgs=dynamic*/ f()] ??= /*@typeArgs=A*/ f(); |
+ var /*@type=C*/ v3 = t /*@target=Test::[]=*/ [ |
+ /*@typeArgs=dynamic*/ f()] += /*@typeArgs=dynamic*/ f(); |
+ var /*@type=C*/ v4 = --t /*@target=Test::[]=*/ [/*@typeArgs=dynamic*/ f()]; |
+ var /*@type=A*/ v5 = t /*@target=Test::[]=*/ [/*@typeArgs=dynamic*/ f()]--; |
+ } |
+} |
+ |
+main() {} |