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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2062793003: Revert "Revert "Refactor strong mode to use standard Analyzer errors"" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 46e7434e1ca442b8853cfb0092776f0c45a3514c..b0717f2ca5cbe92874a49bc7b972fbc908b76d75 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -269,8 +269,8 @@ main() {
f = /*info:INFERRED_TYPE_CLOSURE*/(x) => 'hello';
- foo(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) { return null; });
- foo(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) { throw "not implemented"; });
+ foo(/*info:INFERRED_TYPE_CLOSURE*/(x) { return null; });
+ foo(/*info:INFERRED_TYPE_CLOSURE*/(x) { throw "not implemented"; });
}
''');
@@ -318,7 +318,7 @@ var f = () sync* { yield null; };
main() {
String f() => null;
var g = f;
- g = /*info:INFERRED_TYPE_CLOSURE*/() { return /*warning:RETURN_OF_INVALID_TYPE*/1; };
+ g = /*info:INFERRED_TYPE_CLOSURE*/() { return /*severe:RETURN_OF_INVALID_TYPE*/1; };
}
''');
var f = mainUnit.functions[0].localVariables[0];
@@ -340,7 +340,7 @@ var g = f;
import 'dart:math' show Random;
test2() {
List<num> o;
- var y = o.map(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) {
+ var y = o.map(/*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/(x) {
if (new Random().nextBool()) {
return x.toInt() + 1;
} else {
@@ -619,11 +619,11 @@ class A {
test() {
x = "hi";
- y = /*warning:INVALID_ASSIGNMENT*/"hi";
+ y = /*severe:INVALID_ASSIGNMENT*/"hi";
A.x = "hi";
- A.y = /*warning:INVALID_ASSIGNMENT*/"hi";
+ A.y = /*severe:INVALID_ASSIGNMENT*/"hi";
new A().x2 = "hi";
- new A().y2 = /*warning:INVALID_ASSIGNMENT*/"hi";
+ new A().y2 = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -820,29 +820,29 @@ void main () {
{
Function2<int, String> l0 = /*info:INFERRED_TYPE_CLOSURE*/(int x) => null;
Function2<int, String> l1 = (int x) => "hello";
- Function2<int, String> l2 = /*warning:INVALID_ASSIGNMENT*/(String x) => "hello";
- Function2<int, String> l3 = /*warning:INVALID_ASSIGNMENT*/(int x) => 3;
- Function2<int, String> l4 = /*info:INFERRED_TYPE_CLOSURE*/(int x) {return /*warning:RETURN_OF_INVALID_TYPE*/3;};
+ Function2<int, String> l2 = /*severe:INVALID_ASSIGNMENT*/(String x) => "hello";
+ Function2<int, String> l3 = /*severe:INVALID_ASSIGNMENT*/(int x) => 3;
+ Function2<int, String> l4 = /*info:INFERRED_TYPE_CLOSURE*/(int x) {return /*severe:RETURN_OF_INVALID_TYPE*/3;};
}
{
- Function2<int, String> l0 = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/(x) => null;
+ Function2<int, String> l0 = /*info:INFERRED_TYPE_CLOSURE*/(x) => null;
Function2<int, String> l1 = /*info:INFERRED_TYPE_CLOSURE*/(x) => "hello";
- Function2<int, String> l2 = /*info:INFERRED_TYPE_CLOSURE, warning:INVALID_ASSIGNMENT*/(x) => 3;
- Function2<int, String> l3 = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/(x) {return /*warning:RETURN_OF_INVALID_TYPE*/3;};
- Function2<int, String> l4 = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/(x) {return /*warning:RETURN_OF_INVALID_TYPE*/x;};
+ Function2<int, String> l2 = /*info:INFERRED_TYPE_CLOSURE, severe:INVALID_ASSIGNMENT*/(x) => 3;
+ Function2<int, String> l3 = /*info:INFERRED_TYPE_CLOSURE*/(x) {return /*severe:RETURN_OF_INVALID_TYPE*/3;};
+ Function2<int, String> l4 = /*info:INFERRED_TYPE_CLOSURE*/(x) {return /*severe:RETURN_OF_INVALID_TYPE*/x;};
}
{
Function2<int, List<String>> l0 = /*info:INFERRED_TYPE_CLOSURE*/(int x) => null;
Function2<int, List<String>> l1 = (int x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
- Function2<int, List<String>> l2 = /*warning:INVALID_ASSIGNMENT*/(String x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
+ Function2<int, List<String>> l2 = /*severe:INVALID_ASSIGNMENT*/(String x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
Function2<int, List<String>> l3 = (int x) => /*info:INFERRED_TYPE_LITERAL*/[/*warning:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/3];
Function2<int, List<String>> l4 = /*info:INFERRED_TYPE_CLOSURE*/(int x) {return /*info:INFERRED_TYPE_LITERAL*/[/*warning:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/3];};
}
{
Function2<int, int> l0 = /*info:INFERRED_TYPE_CLOSURE*/(x) => x;
Function2<int, int> l1 = /*info:INFERRED_TYPE_CLOSURE*/(x) => x+1;
- Function2<int, String> l2 = /*info:INFERRED_TYPE_CLOSURE, warning:INVALID_ASSIGNMENT*/(x) => x;
- Function2<int, String> l3 = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*/(x) => /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/x.substring(3);
+ Function2<int, String> l2 = /*info:INFERRED_TYPE_CLOSURE, severe:INVALID_ASSIGNMENT*/(x) => x;
+ Function2<int, String> l3 = /*info:INFERRED_TYPE_CLOSURE*/(x) => /*info:DYNAMIC_CAST, info:DYNAMIC_INVOKE*/x.substring(3);
Function2<String, String> l4 = /*info:INFERRED_TYPE_CLOSURE*/(x) => x.substring(3);
}
}
@@ -940,25 +940,25 @@ void main () {
var v = f;
v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(int x) => null;
v = /*<T>*/(int x) => "hello";
- v = /*warning:INVALID_ASSIGNMENT*//*<T>*/(String x) => "hello";
- v = /*warning:INVALID_ASSIGNMENT*//*<T>*/(int x) => 3;
- v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(int x) {return /*warning:RETURN_OF_INVALID_TYPE*/3;};
+ v = /*severe:INVALID_ASSIGNMENT*//*<T>*/(String x) => "hello";
+ v = /*severe:INVALID_ASSIGNMENT*//*<T>*/(int x) => 3;
+ v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(int x) {return /*severe:RETURN_OF_INVALID_TYPE*/3;};
}
{
String f/*<S>*/(int x) => null;
var v = f;
v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) => null;
v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) => "hello";
- v = /*info:INFERRED_TYPE_CLOSURE, warning:INVALID_ASSIGNMENT*//*<T>*/(x) => 3;
- v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) {return /*warning:RETURN_OF_INVALID_TYPE*/3;};
- v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) {return /*warning:RETURN_OF_INVALID_TYPE*/x;};
+ v = /*info:INFERRED_TYPE_CLOSURE, severe:INVALID_ASSIGNMENT*//*<T>*/(x) => 3;
+ v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) {return /*severe:RETURN_OF_INVALID_TYPE*/3;};
+ v = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) {return /*severe:RETURN_OF_INVALID_TYPE*/x;};
}
{
List<String> f/*<S>*/(int x) => null;
var v = f;
v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(int x) => null;
v = /*<T>*/(int x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
- v = /*warning:INVALID_ASSIGNMENT*//*<T>*/(String x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
+ v = /*severe:INVALID_ASSIGNMENT*//*<T>*/(String x) => /*info:INFERRED_TYPE_LITERAL*/["hello"];
v = /*<T>*/(int x) => /*info:INFERRED_TYPE_LITERAL*/[/*warning:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/3];
v = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(int x) {return /*info:INFERRED_TYPE_LITERAL*/[/*warning:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/3];};
}
@@ -970,7 +970,7 @@ void main () {
x = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) => x;
x = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) => x+1;
var y = int2String;
- y = /*info:INFERRED_TYPE_CLOSURE, warning:INVALID_ASSIGNMENT*//*<T>*/(x) => x;
+ y = /*info:INFERRED_TYPE_CLOSURE, severe:INVALID_ASSIGNMENT*//*<T>*/(x) => x;
y = /*info:INFERRED_TYPE_CLOSURE, info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) => /*info:DYNAMIC_INVOKE, info:DYNAMIC_CAST*/x.substring(3);
var z = string2String;
z = /*info:INFERRED_TYPE_CLOSURE*//*<T>*/(x) => x.substring(3);
@@ -1281,15 +1281,15 @@ void main() {
import 'dart:async';
Stream<List<int>> foo() async* {
yield /*info:INFERRED_TYPE_LITERAL*/[];
- yield /*warning:YIELD_OF_INVALID_TYPE*/new Stream();
- yield* /*warning:YIELD_OF_INVALID_TYPE*/[];
+ yield /*severe:YIELD_OF_INVALID_TYPE*/new Stream();
+ yield* /*severe:YIELD_OF_INVALID_TYPE*/[];
yield* /*info:INFERRED_TYPE_ALLOCATION*/new Stream();
}
Iterable<Map<int, int>> bar() sync* {
yield /*info:INFERRED_TYPE_LITERAL*/{};
- yield /*warning:YIELD_OF_INVALID_TYPE*/new List();
- yield* /*warning:YIELD_OF_INVALID_TYPE*/{};
+ yield /*severe:YIELD_OF_INVALID_TYPE*/new List();
+ yield* /*severe:YIELD_OF_INVALID_TYPE*/{};
yield* /*info:INFERRED_TYPE_ALLOCATION*/new List();
}
''');
@@ -1397,7 +1397,7 @@ class D extends C {
/*severe:INVALID_METHOD_OVERRIDE*/m(x) => x;
}
main() {
- int y = /*info:DYNAMIC_CAST*/new D()./*warning:WRONG_NUMBER_OF_TYPE_ARGUMENTS*/m/*<int>*/(42);
+ int y = /*info:DYNAMIC_CAST*/new D()./*severe:WRONG_NUMBER_OF_TYPE_ARGUMENTS*/m/*<int>*/(42);
print(y);
}
''');
@@ -1605,10 +1605,10 @@ main() {
checkFile('''
import 'dart:_foreign_helper' show JS;
main() {
- String x = /*warning:INVALID_ASSIGNMENT*/JS('int', '42');
+ String x = /*severe:INVALID_ASSIGNMENT*/JS('int', '42');
var y = JS('String', '"hello"');
y = "world";
- y = /*warning:INVALID_ASSIGNMENT*/42;
+ y = /*severe:INVALID_ASSIGNMENT*/42;
}
''');
}
@@ -1901,13 +1901,13 @@ foo() {
int i;
s = /*info:DYNAMIC_CAST*/new B().x;
- s = /*warning:INVALID_ASSIGNMENT*/new B().y;
+ s = /*severe:INVALID_ASSIGNMENT*/new B().y;
s = new B().z;
- s = /*warning:INVALID_ASSIGNMENT*/new B().w;
+ s = /*severe:INVALID_ASSIGNMENT*/new B().w;
i = /*info:DYNAMIC_CAST*/new B().x;
i = new B().y;
- i = /*warning:INVALID_ASSIGNMENT*/new B().z;
+ i = /*severe:INVALID_ASSIGNMENT*/new B().z;
i = new B().w;
}
''');
@@ -2078,32 +2078,32 @@ var f = 2 + 3; // binary expressions are OK if the left operand
// conected component.
var g = -3;
var h = new A() + 3;
-var i = /*warning:UNDEFINED_OPERATOR*/- new A();
+var i = /*severe:UNDEFINED_OPERATOR*/- new A();
var j = null as B;
test1() {
- a = /*warning:INVALID_ASSIGNMENT*/"hi";
+ a = /*severe:INVALID_ASSIGNMENT*/"hi";
a = new B(3);
- b = /*warning:INVALID_ASSIGNMENT*/"hi";
+ b = /*severe:INVALID_ASSIGNMENT*/"hi";
b = new B(3);
c1 = [];
- c1 = /*warning:INVALID_ASSIGNMENT*/{};
+ c1 = /*severe:INVALID_ASSIGNMENT*/{};
c2 = [];
- c2 = /*warning:INVALID_ASSIGNMENT*/{};
+ c2 = /*severe:INVALID_ASSIGNMENT*/{};
d = {};
- d = /*warning:INVALID_ASSIGNMENT*/3;
+ d = /*severe:INVALID_ASSIGNMENT*/3;
e = new A();
- e = /*warning:INVALID_ASSIGNMENT*/{};
+ e = /*severe:INVALID_ASSIGNMENT*/{};
f = 3;
- f = /*warning:INVALID_ASSIGNMENT*/false;
+ f = /*severe:INVALID_ASSIGNMENT*/false;
g = 1;
- g = /*warning:INVALID_ASSIGNMENT*/false;
- h = /*warning:INVALID_ASSIGNMENT*/false;
+ g = /*severe:INVALID_ASSIGNMENT*/false;
+ h = /*severe:INVALID_ASSIGNMENT*/false;
h = new B('b');
i = false;
j = new B('b');
- j = /*warning:INVALID_ASSIGNMENT*/false;
- j = /*warning:INVALID_ASSIGNMENT*/[];
+ j = /*severe:INVALID_ASSIGNMENT*/false;
+ j = /*severe:INVALID_ASSIGNMENT*/[];
}
''');
}
@@ -2136,7 +2136,7 @@ class B implements A {
}
foo() {
- String y = /*warning:INVALID_ASSIGNMENT*/new B().x;
+ String y = /*severe:INVALID_ASSIGNMENT*/new B().x;
int z = new B().x;
}
''');
@@ -2191,8 +2191,8 @@ import 'a.dart';
var y = x;
test1() {
- x = /*warning:INVALID_ASSIGNMENT*/"hi";
- y = /*warning:INVALID_ASSIGNMENT*/"hi";
+ x = /*severe:INVALID_ASSIGNMENT*/"hi";
+ y = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -2208,8 +2208,8 @@ import 'a.dart';
class B { static var y = A.x; }
test1() {
- A.x = /*warning:INVALID_ASSIGNMENT*/"hi";
- B.y = /*warning:INVALID_ASSIGNMENT*/"hi";
+ A.x = /*severe:INVALID_ASSIGNMENT*/"hi";
+ B.y = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -2353,7 +2353,7 @@ class C {
checkFile('''
class Foo {
var x = 1;
- Foo([this.x = /*warning:INVALID_ASSIGNMENT*/"1"]);
+ Foo([this.x = /*severe:INVALID_ASSIGNMENT*/"1"]);
}''');
}
@@ -2798,7 +2798,7 @@ class B extends A {
}
foo() {
- String y = /*warning:INVALID_ASSIGNMENT*/new B().x;
+ String y = /*severe:INVALID_ASSIGNMENT*/new B().x;
int z = new B().x;
}
''');
@@ -2815,7 +2815,7 @@ class B implements A {
}
foo() {
- String y = /*warning:INVALID_ASSIGNMENT*/new B().x;
+ String y = /*severe:INVALID_ASSIGNMENT*/new B().x;
int z = new B().x;
}
''');
@@ -2826,7 +2826,7 @@ foo() {
checkFile('''
test1() {
int x = 3;
- x = /*warning:INVALID_ASSIGNMENT*/"hi";
+ x = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -2835,7 +2835,7 @@ test1() {
checkFile('''
test2() {
var x = 3;
- x = /*warning:INVALID_ASSIGNMENT*/"hi";
+ x = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -2847,13 +2847,13 @@ class A {
test1() {
var a = x;
- a = /*warning:INVALID_ASSIGNMENT*/"hi";
+ a = /*severe:INVALID_ASSIGNMENT*/"hi";
a = 3;
var b = y;
- b = /*warning:INVALID_ASSIGNMENT*/"hi";
+ b = /*severe:INVALID_ASSIGNMENT*/"hi";
b = 4;
var c = z;
- c = /*warning:INVALID_ASSIGNMENT*/"hi";
+ c = /*severe:INVALID_ASSIGNMENT*/"hi";
c = 4;
}
@@ -2869,13 +2869,13 @@ int x = 0;
test1() {
var a = x;
- a = /*warning:INVALID_ASSIGNMENT*/"hi";
+ a = /*severe:INVALID_ASSIGNMENT*/"hi";
a = 3;
var b = y;
- b = /*warning:INVALID_ASSIGNMENT*/"hi";
+ b = /*severe:INVALID_ASSIGNMENT*/"hi";
b = 4;
var c = z;
- c = /*warning:INVALID_ASSIGNMENT*/"hi";
+ c = /*severe:INVALID_ASSIGNMENT*/"hi";
c = 4;
}
@@ -2902,7 +2902,7 @@ class A {
}
foo() {
int y = new C().x;
- String z = /*warning:INVALID_ASSIGNMENT*/new C().x;
+ String z = /*severe:INVALID_ASSIGNMENT*/new C().x;
}
''');
}
@@ -2916,11 +2916,11 @@ class A<T> {
class B implements A<int> {
get x => 3;
- get w => /*warning:RETURN_OF_INVALID_TYPE*/"hello";
+ get w => /*severe:RETURN_OF_INVALID_TYPE*/"hello";
}
foo() {
- String y = /*warning:INVALID_ASSIGNMENT*/new B().x;
+ String y = /*severe:INVALID_ASSIGNMENT*/new B().x;
int z = new B().x;
}
''');
@@ -2938,7 +2938,7 @@ class B<E> extends A<E> {
}
foo() {
- int y = /*warning:INVALID_ASSIGNMENT*/new B<String>().x;
+ int y = /*severe:INVALID_ASSIGNMENT*/new B<String>().x;
String z = new B<String>().x;
}
''');
@@ -2967,7 +2967,7 @@ class B<E> extends A<E> implements M {
}
foo () {
- int y = /*warning:INVALID_ASSIGNMENT*/new B().m(null, null);
+ int y = /*severe:INVALID_ASSIGNMENT*/new B().m(null, null);
String z = new B().m(null, null);
}
''');
@@ -3023,7 +3023,7 @@ class B<E> extends A<E> implements M {
}
foo () {
- int y = /*warning:INVALID_ASSIGNMENT*/new B<String>().m(null, null).value;
+ int y = /*severe:INVALID_ASSIGNMENT*/new B<String>().m(null, null).value;
String z = new B<String>().m(null, null).value;
}
''');
@@ -3038,7 +3038,7 @@ class Foo {
class Bar<T extends Iterable<String>> {
void foo(T t) {
for (var i in t) {
- int x = /*warning:INVALID_ASSIGNMENT*/i;
+ int x = /*severe:INVALID_ASSIGNMENT*/i;
}
}
}
@@ -3046,7 +3046,7 @@ class Bar<T extends Iterable<String>> {
class Baz<T, E extends Iterable<T>, S extends E> {
void foo(S t) {
for (var i in t) {
- int x = /*warning:INVALID_ASSIGNMENT*/i;
+ int x = /*severe:INVALID_ASSIGNMENT*/i;
T y = i;
}
}
@@ -3055,7 +3055,7 @@ class Baz<T, E extends Iterable<T>, S extends E> {
test() {
var list = <Foo>[];
for (var x in list) {
- String y = /*warning:INVALID_ASSIGNMENT*/x;
+ String y = /*severe:INVALID_ASSIGNMENT*/x;
}
for (dynamic x in list) {
@@ -3064,7 +3064,7 @@ test() {
String y = /*info:DYNAMIC_CAST,info:INVALID_ASSIGNMENT*/x;
}
- for (String x in /*warning:FOR_IN_OF_INVALID_ELEMENT_TYPE*/list) {
+ for (String x in /*severe:FOR_IN_OF_INVALID_ELEMENT_TYPE*/list) {
String y = x;
}
@@ -3085,7 +3085,7 @@ test() {
var map = <String, Foo>{};
// Error: map must be an Iterable.
- for (var x in /*warning:FOR_IN_OF_INVALID_TYPE*/map) {
+ for (var x in /*severe:FOR_IN_OF_INVALID_TYPE*/map) {
String y = /*info:DYNAMIC_CAST*/x;
}
@@ -3132,7 +3132,7 @@ class B {
import 'a.dart';
import 'b.dart';
main() {
- new A().x = /*warning:INVALID_ASSIGNMENT*/'foo';
+ new A().x = /*severe:INVALID_ASSIGNMENT*/'foo';
new B().x = 'foo';
}
''');
@@ -3304,7 +3304,7 @@ test1() {
x[3] = 'z';
x[/*warning:ARGUMENT_TYPE_NOT_ASSIGNABLE*/'hi'] = 'w';
x[/*warning:ARGUMENT_TYPE_NOT_ASSIGNABLE*/4.0] = 'u';
- x[3] = /*warning:INVALID_ASSIGNMENT*/42;
+ x[3] = /*severe:INVALID_ASSIGNMENT*/42;
Map<num, String> y = x;
}
@@ -3313,7 +3313,7 @@ test2() {
x[3] = 'z';
x[/*warning:ARGUMENT_TYPE_NOT_ASSIGNABLE*/'hi'] = 'w';
x[4.0] = 'u';
- x[3] = /*warning:INVALID_ASSIGNMENT*/42;
+ x[3] = /*severe:INVALID_ASSIGNMENT*/42;
Pattern p = null;
x[2] = p;
Map<int, String> y = /*info:ASSIGNMENT_CAST*/x;
@@ -3328,7 +3328,7 @@ test1() {
x1[3] = 'z';
x1[/*warning:ARGUMENT_TYPE_NOT_ASSIGNABLE*/'hi'] = 'w';
x1[/*warning:ARGUMENT_TYPE_NOT_ASSIGNABLE*/4.0] = 'u';
- x1[3] = /*warning:INVALID_ASSIGNMENT*/42;
+ x1[3] = /*severe:INVALID_ASSIGNMENT*/42;
Map<num, String> y = x1;
}
@@ -3337,7 +3337,7 @@ test2() {
x2[3] = 'z';
x2[/*warning:ARGUMENT_TYPE_NOT_ASSIGNABLE*/'hi'] = 'w';
x2[4.0] = 'u';
- x2[3] = /*warning:INVALID_ASSIGNMENT*/42;
+ x2[3] = /*severe:INVALID_ASSIGNMENT*/42;
Pattern p = null;
x2[2] = p;
Map<int, String> y = /*info:ASSIGNMENT_CAST*/x2;
@@ -3443,8 +3443,8 @@ main() {
h = 'hello';
(/*info:DYNAMIC_INVOKE*/h.foo());
- foo(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) => null);
- foo(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) => throw "not implemented");
+ foo(/*info:INFERRED_TYPE_CLOSURE*/(x) => null);
+ foo(/*info:INFERRED_TYPE_CLOSURE*/(x) => throw "not implemented");
}
''');
}
@@ -3487,10 +3487,10 @@ class A {
test5() {
var a1 = new A();
- a1.x = /*warning:INVALID_ASSIGNMENT*/"hi";
+ a1.x = /*severe:INVALID_ASSIGNMENT*/"hi";
A a2 = new A();
- a2.x = /*warning:INVALID_ASSIGNMENT*/"hi";
+ a2.x = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -3643,7 +3643,7 @@ class C {
checkFile('''
import 'a.dart';
test() {
- x = /*warning:INVALID_ASSIGNMENT*/"hi";
+ x = /*severe:INVALID_ASSIGNMENT*/"hi";
}
''');
}
@@ -3724,9 +3724,9 @@ class InferredTypeTest extends InferredTypeMixin {
/// * all expected failures are listed in the source code using comments
/// immediately in front of the AST node that should contain the error.
///
- /// * errors are formatted as a token `level:Type`, where `level` is the
- /// logging level were the error would be reported at, and `Type` is the
- /// concrete subclass of [StaticInfo] that denotes the error.
+ /// * errors are formatted as a token `severity:ErrorCode`, where
+ /// `severity` is the ErrorSeverity the error would be reported at, and
+ /// `ErrorCode` is the error code's name.
///
/// For example to check that an assignment produces a type error, you can
/// create a file like:
« no previous file with comments | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | pkg/analyzer/test/src/task/strong/strong_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698