Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: pkg/front_end/testcases/inference/infer_assign_to_index_this_upwards.dart.direct.expect

Issue 2938443003: Add type inference for assignments to `this[...]` (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library test;
2 import self as self;
3 import "dart:core" as core;
4
5 abstract class Test1 extends core::Object {
6 constructor •() → void
7 : super core::Object::•()
8 ;
9 abstract operator [](core::String s) → core::int;
10 abstract operator []=(core::String s, core::int v) → void;
11 method test() → void {
12 dynamic v1 = let final dynamic #t1 = "x" in let final dynamic #t2 = self::ge tInt() in let final dynamic #t3 = this.[]=(#t1, #t2) in #t2;
13 dynamic v2 = let final dynamic #t4 = "x" in let final dynamic #t5 = self::ge tNum() in let final dynamic #t6 = this.[]=(#t4, #t5) in #t5;
14 dynamic v4 = let final dynamic #t7 = "x" in let final dynamic #t8 = this.[]( #t7) in #t8.==(null) ? let final dynamic #t9 = self::getInt() in let final dynam ic #t10 = this.[]=(#t7, #t9) in #t9 : #t8;
15 dynamic v5 = let final dynamic #t11 = "x" in let final dynamic #t12 = this.[ ](#t11) in #t12.==(null) ? let final dynamic #t13 = self::getNum() in let final dynamic #t14 = this.[]=(#t11, #t13) in #t13 : #t12;
16 dynamic v7 = let final dynamic #t15 = "x" in let final dynamic #t16 = this.[ ](#t15).+(self::getInt()) in let final dynamic #t17 = this.[]=(#t15, #t16) in #t 16;
17 dynamic v8 = let final dynamic #t18 = "x" in let final dynamic #t19 = this.[ ](#t18).+(self::getNum()) in let final dynamic #t20 = this.[]=(#t18, #t19) in #t 19;
18 dynamic v10 = let final dynamic #t21 = "x" in let final dynamic #t22 = this. [](#t21).+(1) in let final dynamic #t23 = this.[]=(#t21, #t22) in #t22;
19 dynamic v11 = let final dynamic #t24 = "x" in let final dynamic #t25 = this. [](#t24) in let final dynamic #t26 = this.[]=(#t24, #t25.+(1)) in #t25;
20 }
21 }
22 abstract class Test2 extends core::Object {
23 constructor •() → void
24 : super core::Object::•()
25 ;
26 abstract operator [](core::String s) → core::int;
27 abstract operator []=(core::String s, core::num v) → void;
28 method test() → void {
29 dynamic v1 = let final dynamic #t27 = "x" in let final dynamic #t28 = self:: getInt() in let final dynamic #t29 = this.[]=(#t27, #t28) in #t28;
30 dynamic v2 = let final dynamic #t30 = "x" in let final dynamic #t31 = self:: getNum() in let final dynamic #t32 = this.[]=(#t30, #t31) in #t31;
31 dynamic v3 = let final dynamic #t33 = "x" in let final dynamic #t34 = self:: getDouble() in let final dynamic #t35 = this.[]=(#t33, #t34) in #t34;
32 dynamic v4 = let final dynamic #t36 = "x" in let final dynamic #t37 = this.[ ](#t36) in #t37.==(null) ? let final dynamic #t38 = self::getInt() in let final dynamic #t39 = this.[]=(#t36, #t38) in #t38 : #t37;
33 dynamic v5 = let final dynamic #t40 = "x" in let final dynamic #t41 = this.[ ](#t40) in #t41.==(null) ? let final dynamic #t42 = self::getNum() in let final dynamic #t43 = this.[]=(#t40, #t42) in #t42 : #t41;
34 dynamic v6 = let final dynamic #t44 = "x" in let final dynamic #t45 = this.[ ](#t44) in #t45.==(null) ? let final dynamic #t46 = self::getDouble() in let fin al dynamic #t47 = this.[]=(#t44, #t46) in #t46 : #t45;
35 dynamic v7 = let final dynamic #t48 = "x" in let final dynamic #t49 = this.[ ](#t48).+(self::getInt()) in let final dynamic #t50 = this.[]=(#t48, #t49) in #t 49;
36 dynamic v8 = let final dynamic #t51 = "x" in let final dynamic #t52 = this.[ ](#t51).+(self::getNum()) in let final dynamic #t53 = this.[]=(#t51, #t52) in #t 52;
37 dynamic v9 = let final dynamic #t54 = "x" in let final dynamic #t55 = this.[ ](#t54).+(self::getDouble()) in let final dynamic #t56 = this.[]=(#t54, #t55) in #t55;
38 dynamic v10 = let final dynamic #t57 = "x" in let final dynamic #t58 = this. [](#t57).+(1) in let final dynamic #t59 = this.[]=(#t57, #t58) in #t58;
39 dynamic v11 = let final dynamic #t60 = "x" in let final dynamic #t61 = this. [](#t60) in let final dynamic #t62 = this.[]=(#t60, #t61.+(1)) in #t61;
40 }
41 }
42 abstract class Test3 extends core::Object {
43 constructor •() → void
44 : super core::Object::•()
45 ;
46 abstract operator [](core::String s) → core::int;
47 abstract operator []=(core::String s, core::double v) → void;
48 method test() → void {
49 dynamic v2 = let final dynamic #t63 = "x" in let final dynamic #t64 = self:: getNum() in let final dynamic #t65 = this.[]=(#t63, #t64) in #t64;
50 dynamic v3 = let final dynamic #t66 = "x" in let final dynamic #t67 = self:: getDouble() in let final dynamic #t68 = this.[]=(#t66, #t67) in #t67;
51 dynamic v5 = let final dynamic #t69 = "x" in let final dynamic #t70 = this.[ ](#t69) in #t70.==(null) ? let final dynamic #t71 = self::getNum() in let final dynamic #t72 = this.[]=(#t69, #t71) in #t71 : #t70;
52 dynamic v6 = let final dynamic #t73 = "x" in let final dynamic #t74 = this.[ ](#t73) in #t74.==(null) ? let final dynamic #t75 = self::getDouble() in let fin al dynamic #t76 = this.[]=(#t73, #t75) in #t75 : #t74;
53 dynamic v7 = let final dynamic #t77 = "x" in let final dynamic #t78 = this.[ ](#t77).+(self::getInt()) in let final dynamic #t79 = this.[]=(#t77, #t78) in #t 78;
54 dynamic v8 = let final dynamic #t80 = "x" in let final dynamic #t81 = this.[ ](#t80).+(self::getNum()) in let final dynamic #t82 = this.[]=(#t80, #t81) in #t 81;
55 dynamic v9 = let final dynamic #t83 = "x" in let final dynamic #t84 = this.[ ](#t83).+(self::getDouble()) in let final dynamic #t85 = this.[]=(#t83, #t84) in #t84;
56 dynamic v10 = let final dynamic #t86 = "x" in let final dynamic #t87 = this. [](#t86).+(1) in let final dynamic #t88 = this.[]=(#t86, #t87) in #t87;
57 dynamic v11 = let final dynamic #t89 = "x" in let final dynamic #t90 = this. [](#t89) in let final dynamic #t91 = this.[]=(#t89, #t90.+(1)) in #t90;
58 }
59 }
60 abstract class Test4 extends core::Object {
61 constructor •() → void
62 : super core::Object::•()
63 ;
64 abstract operator [](core::String s) → core::num;
65 abstract operator []=(core::String s, core::int v) → void;
66 method test() → void {
67 dynamic v1 = let final dynamic #t92 = "x" in let final dynamic #t93 = self:: getInt() in let final dynamic #t94 = this.[]=(#t92, #t93) in #t93;
68 dynamic v2 = let final dynamic #t95 = "x" in let final dynamic #t96 = self:: getNum() in let final dynamic #t97 = this.[]=(#t95, #t96) in #t96;
69 dynamic v4 = let final dynamic #t98 = "x" in let final dynamic #t99 = this.[ ](#t98) in #t99.==(null) ? let final dynamic #t100 = self::getInt() in let final dynamic #t101 = this.[]=(#t98, #t100) in #t100 : #t99;
70 dynamic v5 = let final dynamic #t102 = "x" in let final dynamic #t103 = this .[](#t102) in #t103.==(null) ? let final dynamic #t104 = self::getNum() in let f inal dynamic #t105 = this.[]=(#t102, #t104) in #t104 : #t103;
71 dynamic v7 = let final dynamic #t106 = "x" in let final dynamic #t107 = this .[](#t106).+(self::getInt()) in let final dynamic #t108 = this.[]=(#t106, #t107) in #t107;
72 dynamic v8 = let final dynamic #t109 = "x" in let final dynamic #t110 = this .[](#t109).+(self::getNum()) in let final dynamic #t111 = this.[]=(#t109, #t110) in #t110;
73 dynamic v10 = let final dynamic #t112 = "x" in let final dynamic #t113 = thi s.[](#t112).+(1) in let final dynamic #t114 = this.[]=(#t112, #t113) in #t113;
74 dynamic v11 = let final dynamic #t115 = "x" in let final dynamic #t116 = thi s.[](#t115) in let final dynamic #t117 = this.[]=(#t115, #t116.+(1)) in #t116;
75 }
76 }
77 abstract class Test5 extends core::Object {
78 constructor •() → void
79 : super core::Object::•()
80 ;
81 abstract operator [](core::String s) → core::num;
82 abstract operator []=(core::String s, core::num v) → void;
83 method test() → void {
84 dynamic v1 = let final dynamic #t118 = "x" in let final dynamic #t119 = self ::getInt() in let final dynamic #t120 = this.[]=(#t118, #t119) in #t119;
85 dynamic v2 = let final dynamic #t121 = "x" in let final dynamic #t122 = self ::getNum() in let final dynamic #t123 = this.[]=(#t121, #t122) in #t122;
86 dynamic v3 = let final dynamic #t124 = "x" in let final dynamic #t125 = self ::getDouble() in let final dynamic #t126 = this.[]=(#t124, #t125) in #t125;
87 dynamic v4 = let final dynamic #t127 = "x" in let final dynamic #t128 = this .[](#t127) in #t128.==(null) ? let final dynamic #t129 = self::getInt() in let f inal dynamic #t130 = this.[]=(#t127, #t129) in #t129 : #t128;
88 dynamic v5 = let final dynamic #t131 = "x" in let final dynamic #t132 = this .[](#t131) in #t132.==(null) ? let final dynamic #t133 = self::getNum() in let f inal dynamic #t134 = this.[]=(#t131, #t133) in #t133 : #t132;
89 dynamic v6 = let final dynamic #t135 = "x" in let final dynamic #t136 = this .[](#t135) in #t136.==(null) ? let final dynamic #t137 = self::getDouble() in le t final dynamic #t138 = this.[]=(#t135, #t137) in #t137 : #t136;
90 dynamic v7 = let final dynamic #t139 = "x" in let final dynamic #t140 = this .[](#t139).+(self::getInt()) in let final dynamic #t141 = this.[]=(#t139, #t140) in #t140;
91 dynamic v8 = let final dynamic #t142 = "x" in let final dynamic #t143 = this .[](#t142).+(self::getNum()) in let final dynamic #t144 = this.[]=(#t142, #t143) in #t143;
92 dynamic v9 = let final dynamic #t145 = "x" in let final dynamic #t146 = this .[](#t145).+(self::getDouble()) in let final dynamic #t147 = this.[]=(#t145, #t1 46) in #t146;
93 dynamic v10 = let final dynamic #t148 = "x" in let final dynamic #t149 = thi s.[](#t148).+(1) in let final dynamic #t150 = this.[]=(#t148, #t149) in #t149;
94 dynamic v11 = let final dynamic #t151 = "x" in let final dynamic #t152 = thi s.[](#t151) in let final dynamic #t153 = this.[]=(#t151, #t152.+(1)) in #t152;
95 }
96 }
97 abstract class Test6 extends core::Object {
98 constructor •() → void
99 : super core::Object::•()
100 ;
101 abstract operator [](core::String s) → core::num;
102 abstract operator []=(core::String s, core::double v) → void;
103 method test() → void {
104 dynamic v2 = let final dynamic #t154 = "x" in let final dynamic #t155 = self ::getNum() in let final dynamic #t156 = this.[]=(#t154, #t155) in #t155;
105 dynamic v3 = let final dynamic #t157 = "x" in let final dynamic #t158 = self ::getDouble() in let final dynamic #t159 = this.[]=(#t157, #t158) in #t158;
106 dynamic v5 = let final dynamic #t160 = "x" in let final dynamic #t161 = this .[](#t160) in #t161.==(null) ? let final dynamic #t162 = self::getNum() in let f inal dynamic #t163 = this.[]=(#t160, #t162) in #t162 : #t161;
107 dynamic v6 = let final dynamic #t164 = "x" in let final dynamic #t165 = this .[](#t164) in #t165.==(null) ? let final dynamic #t166 = self::getDouble() in le t final dynamic #t167 = this.[]=(#t164, #t166) in #t166 : #t165;
108 dynamic v7 = let final dynamic #t168 = "x" in let final dynamic #t169 = this .[](#t168).+(self::getInt()) in let final dynamic #t170 = this.[]=(#t168, #t169) in #t169;
109 dynamic v8 = let final dynamic #t171 = "x" in let final dynamic #t172 = this .[](#t171).+(self::getNum()) in let final dynamic #t173 = this.[]=(#t171, #t172) in #t172;
110 dynamic v9 = let final dynamic #t174 = "x" in let final dynamic #t175 = this .[](#t174).+(self::getDouble()) in let final dynamic #t176 = this.[]=(#t174, #t1 75) in #t175;
111 dynamic v10 = let final dynamic #t177 = "x" in let final dynamic #t178 = thi s.[](#t177).+(1) in let final dynamic #t179 = this.[]=(#t177, #t178) in #t178;
112 dynamic v11 = let final dynamic #t180 = "x" in let final dynamic #t181 = thi s.[](#t180) in let final dynamic #t182 = this.[]=(#t180, #t181.+(1)) in #t181;
113 }
114 }
115 abstract class Test7 extends core::Object {
116 constructor •() → void
117 : super core::Object::•()
118 ;
119 abstract operator [](core::String s) → core::double;
120 abstract operator []=(core::String s, core::int v) → void;
121 method test() → void {
122 dynamic v1 = let final dynamic #t183 = "x" in let final dynamic #t184 = self ::getInt() in let final dynamic #t185 = this.[]=(#t183, #t184) in #t184;
123 dynamic v2 = let final dynamic #t186 = "x" in let final dynamic #t187 = self ::getNum() in let final dynamic #t188 = this.[]=(#t186, #t187) in #t187;
124 dynamic v4 = let final dynamic #t189 = "x" in let final dynamic #t190 = this .[](#t189) in #t190.==(null) ? let final dynamic #t191 = self::getInt() in let f inal dynamic #t192 = this.[]=(#t189, #t191) in #t191 : #t190;
125 dynamic v5 = let final dynamic #t193 = "x" in let final dynamic #t194 = this .[](#t193) in #t194.==(null) ? let final dynamic #t195 = self::getNum() in let f inal dynamic #t196 = this.[]=(#t193, #t195) in #t195 : #t194;
126 dynamic v7 = let final dynamic #t197 = "x" in let final dynamic #t198 = this .[](#t197).+(self::getInt()) in let final dynamic #t199 = this.[]=(#t197, #t198) in #t198;
127 dynamic v8 = let final dynamic #t200 = "x" in let final dynamic #t201 = this .[](#t200).+(self::getNum()) in let final dynamic #t202 = this.[]=(#t200, #t201) in #t201;
128 dynamic v10 = let final dynamic #t203 = "x" in let final dynamic #t204 = thi s.[](#t203).+(1) in let final dynamic #t205 = this.[]=(#t203, #t204) in #t204;
129 dynamic v11 = let final dynamic #t206 = "x" in let final dynamic #t207 = thi s.[](#t206) in let final dynamic #t208 = this.[]=(#t206, #t207.+(1)) in #t207;
130 }
131 }
132 abstract class Test8 extends core::Object {
133 constructor •() → void
134 : super core::Object::•()
135 ;
136 abstract operator [](core::String s) → core::double;
137 abstract operator []=(core::String s, core::num v) → void;
138 method test() → void {
139 dynamic v1 = let final dynamic #t209 = "x" in let final dynamic #t210 = self ::getInt() in let final dynamic #t211 = this.[]=(#t209, #t210) in #t210;
140 dynamic v2 = let final dynamic #t212 = "x" in let final dynamic #t213 = self ::getNum() in let final dynamic #t214 = this.[]=(#t212, #t213) in #t213;
141 dynamic v3 = let final dynamic #t215 = "x" in let final dynamic #t216 = self ::getDouble() in let final dynamic #t217 = this.[]=(#t215, #t216) in #t216;
142 dynamic v4 = let final dynamic #t218 = "x" in let final dynamic #t219 = this .[](#t218) in #t219.==(null) ? let final dynamic #t220 = self::getInt() in let f inal dynamic #t221 = this.[]=(#t218, #t220) in #t220 : #t219;
143 dynamic v5 = let final dynamic #t222 = "x" in let final dynamic #t223 = this .[](#t222) in #t223.==(null) ? let final dynamic #t224 = self::getNum() in let f inal dynamic #t225 = this.[]=(#t222, #t224) in #t224 : #t223;
144 dynamic v6 = let final dynamic #t226 = "x" in let final dynamic #t227 = this .[](#t226) in #t227.==(null) ? let final dynamic #t228 = self::getDouble() in le t final dynamic #t229 = this.[]=(#t226, #t228) in #t228 : #t227;
145 dynamic v7 = let final dynamic #t230 = "x" in let final dynamic #t231 = this .[](#t230).+(self::getInt()) in let final dynamic #t232 = this.[]=(#t230, #t231) in #t231;
146 dynamic v8 = let final dynamic #t233 = "x" in let final dynamic #t234 = this .[](#t233).+(self::getNum()) in let final dynamic #t235 = this.[]=(#t233, #t234) in #t234;
147 dynamic v9 = let final dynamic #t236 = "x" in let final dynamic #t237 = this .[](#t236).+(self::getDouble()) in let final dynamic #t238 = this.[]=(#t236, #t2 37) in #t237;
148 dynamic v10 = let final dynamic #t239 = "x" in let final dynamic #t240 = thi s.[](#t239).+(1) in let final dynamic #t241 = this.[]=(#t239, #t240) in #t240;
149 dynamic v11 = let final dynamic #t242 = "x" in let final dynamic #t243 = thi s.[](#t242) in let final dynamic #t244 = this.[]=(#t242, #t243.+(1)) in #t243;
150 }
151 }
152 abstract class Test9 extends core::Object {
153 constructor •() → void
154 : super core::Object::•()
155 ;
156 abstract operator [](core::String s) → core::double;
157 abstract operator []=(core::String s, core::double v) → void;
158 method test() → void {
159 dynamic v2 = let final dynamic #t245 = "x" in let final dynamic #t246 = self ::getNum() in let final dynamic #t247 = this.[]=(#t245, #t246) in #t246;
160 dynamic v3 = let final dynamic #t248 = "x" in let final dynamic #t249 = self ::getDouble() in let final dynamic #t250 = this.[]=(#t248, #t249) in #t249;
161 dynamic v5 = let final dynamic #t251 = "x" in let final dynamic #t252 = this .[](#t251) in #t252.==(null) ? let final dynamic #t253 = self::getNum() in let f inal dynamic #t254 = this.[]=(#t251, #t253) in #t253 : #t252;
162 dynamic v6 = let final dynamic #t255 = "x" in let final dynamic #t256 = this .[](#t255) in #t256.==(null) ? let final dynamic #t257 = self::getDouble() in le t final dynamic #t258 = this.[]=(#t255, #t257) in #t257 : #t256;
163 dynamic v7 = let final dynamic #t259 = "x" in let final dynamic #t260 = this .[](#t259).+(self::getInt()) in let final dynamic #t261 = this.[]=(#t259, #t260) in #t260;
164 dynamic v8 = let final dynamic #t262 = "x" in let final dynamic #t263 = this .[](#t262).+(self::getNum()) in let final dynamic #t264 = this.[]=(#t262, #t263) in #t263;
165 dynamic v9 = let final dynamic #t265 = "x" in let final dynamic #t266 = this .[](#t265).+(self::getDouble()) in let final dynamic #t267 = this.[]=(#t265, #t2 66) in #t266;
166 dynamic v10 = let final dynamic #t268 = "x" in let final dynamic #t269 = thi s.[](#t268).+(1) in let final dynamic #t270 = this.[]=(#t268, #t269) in #t269;
167 dynamic v11 = let final dynamic #t271 = "x" in let final dynamic #t272 = thi s.[](#t271) in let final dynamic #t273 = this.[]=(#t271, #t272.+(1)) in #t272;
168 }
169 }
170 static method getInt() → core::int
171 return 0;
172 static method getNum() → core::num
173 return 0;
174 static method getDouble() → core::double
175 return 0.0;
176 static method main() → dynamic {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698