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

Side by Side Diff: tests/language/super_bound_closure_test.dart

Issue 700923002: Warn when implicit default value overrides explicit one that differs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 class A { 7 class A {
8 bar([var optional = 1]) => 498 + optional; 8 bar([var optional = 1]) => 498 + optional;
9 bar2({ namedOptional: 2 }) => 40 + namedOptional; 9 bar2({ namedOptional: 2 }) => 40 + namedOptional;
10 bar3(x, [var optional = 3]) => x + 498 + optional; 10 bar3(x, [var optional = 3]) => x + 498 + optional;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 fooIntercept21() => confuse(super.shuffle)(); 66 fooIntercept21() => confuse(super.shuffle)();
67 fooIntercept22() => confuse(super.shuffle)(2); 67 fooIntercept22() => confuse(super.shuffle)(2);
68 fooIntercept23() => confuse(super.toList)(); 68 fooIntercept23() => confuse(super.toList)();
69 fooIntercept24() => confuse(super.toList)(growable: 77); 69 fooIntercept24() => confuse(super.toList)(growable: 77);
70 fooIntercept25() => confuse(super.lastIndexOf)(-3); 70 fooIntercept25() => confuse(super.lastIndexOf)(-3);
71 fooIntercept26() => confuse(super.lastIndexOf)(-11, -19); 71 fooIntercept26() => confuse(super.lastIndexOf)(-11, -19);
72 fooIntercept27() => confuse(super.lastWhere)(0); 72 fooIntercept27() => confuse(super.lastWhere)(0);
73 fooIntercept28() => confuse(super.lastWhere)(3, orElse: 77); 73 fooIntercept28() => confuse(super.lastWhere)(3, orElse: 77);
74 74
75 bar([var optional]) => -1; 75 bar([var optional]) => -1; /// 01: static type warning
76 bar2({ namedOptional }) => -1; 76 bar2({ namedOptional }) => -1; /// 01: continued
77 bar3(x, [var optional]) => -1; 77 bar3(x, [var optional]) => -1; /// 01: continued
78 bar4(x, { namedOptional }) => -1; 78 bar4(x, { namedOptional }) => -1; /// 01: continued
79 79
80 gee([var optional]) => -1; 80 gee([var optional]) => -1; /// 01: continued
81 gee2({ namedOptional }) => -1; 81 gee2({ namedOptional }) => -1; /// 01: continued
82 gee3(x, [var optional]) => -1; 82 gee3(x, [var optional]) => -1; /// 01: continued
83 gee4(x, { namedOptional }) => -1; 83 gee4(x, { namedOptional }) => -1; /// 01: continued
84 84
85 add([var optional = 33]) => -1; 85 add([var optional = 33]) => -1;
86 trim({ namedOptional: 22 }) => -1; 86 trim({ namedOptional: 22 }) => -1;
87 sublist(x, [optional = 44]) => -1; 87 sublist(x, [optional = 44]) => -1;
88 splitMapJoin(x, { onMatch: 55, onNonMatch: 66}) => -1; 88 splitMapJoin(x, { onMatch: 55, onNonMatch: 66}) => -1;
89 89
90 shuffle([var optional = 121]) => -1; 90 shuffle([var optional = 121]) => -1;
91 toList({ growable: 2233 }) => -1; 91 toList({ growable: 2233 }) => -1;
92 lastIndexOf(x, [optional = 424]) => -1; 92 lastIndexOf(x, [optional = 424]) => -1;
93 lastWhere(x, { orElse: 555 }) => -1; 93 lastWhere(x, { orElse: 555 }) => -1;
94 } 94 }
95 95
96 confuse(x) { 96 confuse(x) {
97 if (new DateTime.now().millisecondsSinceEpoch == 42) return confuse(x - 1); 97 if (new DateTime.now().millisecondsSinceEpoch == 42) return confuse(x - 1);
98 return x; 98 return x;
99 } 99 }
100 100
101 main() { 101 main() {
102 var list = [new A(), new B(), [], "foo" ]; 102 var list = [new A(), new B(), [], "foo" ];
103 var a = list[confuse(0)]; 103 var a = list[confuse(0)];
104 var b = list[confuse(1)]; 104 var b = list[confuse(1)];
105 var ignored = list[confuse(2)]; 105 var ignored = list[confuse(2)];
106 var ignored2 = list[confuse(3)]; 106 var ignored2 = list[confuse(3)];
107 107
108 var t = b.gee() + b.gee2() + b.gee3(9) + b.gee4(19); 108 var t = b.gee() + b.gee2() + b.gee3(9) + b.gee4(19);
109 Expect.equals(-4, t); 109 Expect.equals(-4, t); /// 01: continued
110 t = b.shuffle() + b.toList() + b.lastIndexOf(1) + b.lastWhere(2); 110 t = b.shuffle() + b.toList() + b.lastIndexOf(1) + b.lastWhere(2);
111 Expect.equals(-4, t); 111 Expect.equals(-4, t);
112 112
113 Expect.equals(499, b.foo()); 113 Expect.equals(499, b.foo()); /// 01: continued
114 Expect.equals(500, b.foo2()); 114 Expect.equals(500, b.foo2()); /// 01: continued
115 Expect.equals(42, b.foo3()); 115 Expect.equals(42, b.foo3()); /// 01: continued
116 Expect.equals(117, b.foo4()); 116 Expect.equals(117, b.foo4()); /// 01: continued
117 Expect.equals(498, b.foo5()); 117 Expect.equals(498, b.foo5()); /// 01: continued
118 Expect.equals(468, b.foo6()); 118 Expect.equals(468, b.foo6()); /// 01: continued
119 Expect.equals(426, b.foo7()); 119 Expect.equals(426, b.foo7()); /// 01: continued
120 Expect.equals(502, b.foo8()); 120 Expect.equals(502, b.foo8()); /// 01: continued
121 121
122 Expect.equals(499, b.fooGee()); 122 Expect.equals(499, b.fooGee()); /// 01: continued
123 Expect.equals(500, b.fooGee2()); 123 Expect.equals(500, b.fooGee2()); /// 01: continued
124 Expect.equals(42, b.fooGee3()); 124 Expect.equals(42, b.fooGee3()); /// 01: continued
125 Expect.equals(117, b.fooGee4()); 125 Expect.equals(117, b.fooGee4()); /// 01: continued
126 Expect.equals(498, b.fooGee5()); 126 Expect.equals(498, b.fooGee5()); /// 01: continued
127 Expect.equals(468, b.fooGee6()); 127 Expect.equals(468, b.fooGee6()); /// 01: continued
128 Expect.equals(426, b.fooGee7()); 128 Expect.equals(426, b.fooGee7()); /// 01: continued
129 Expect.equals(502, b.fooGee8()); 129 Expect.equals(502, b.fooGee8()); /// 01: continued
130 130
131 Expect.equals(1267, b.fooIntercept()); 131 Expect.equals(1267, b.fooIntercept());
132 Expect.equals(1236, b.fooIntercept2()); 132 Expect.equals(1236, b.fooIntercept2());
133 Expect.equals(1335, b.fooIntercept3()); 133 Expect.equals(1335, b.fooIntercept3());
134 Expect.equals(1390, b.fooIntercept4()); 134 Expect.equals(1390, b.fooIntercept4());
135 Expect.equals(4362, b.fooIntercept5()); 135 Expect.equals(4362, b.fooIntercept5());
136 Expect.equals(4291, b.fooIntercept6()); 136 Expect.equals(4291, b.fooIntercept6());
137 Expect.equals(232, b.fooIntercept7()); 137 Expect.equals(232, b.fooIntercept7());
138 Expect.equals(199, b.fooIntercept8()); 138 Expect.equals(199, b.fooIntercept8());
139 139
140 Expect.equals(12463, b.fooIntercept21()); 140 Expect.equals(12463, b.fooIntercept21());
141 Expect.equals(12344, b.fooIntercept22()); 141 Expect.equals(12344, b.fooIntercept22());
142 Expect.equals(15364, b.fooIntercept23()); 142 Expect.equals(15364, b.fooIntercept23());
143 Expect.equals(13208, b.fooIntercept24()); 143 Expect.equals(13208, b.fooIntercept24());
144 Expect.equals(14742, b.fooIntercept25()); 144 Expect.equals(14742, b.fooIntercept25());
145 Expect.equals(14291, b.fooIntercept26()); 145 Expect.equals(14291, b.fooIntercept26());
146 Expect.equals(1768, b.fooIntercept27()); 146 Expect.equals(1768, b.fooIntercept27());
147 Expect.equals(1771, b.fooIntercept28()); 147 Expect.equals(1771, b.fooIntercept28());
148 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698