Skip to content

Commit

Permalink
Log the runtime type of messages
Browse files Browse the repository at this point in the history
This makes is a little easier to investigate errors.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/993513005
  • Loading branch information
vsmenon committed Mar 9, 2015
1 parent 4e4dd98 commit 74476b5
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
3 changes: 2 additions & 1 deletion pkg/dev_compiler/lib/src/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class LogReporter implements CheckerReporter {
: _file.span(message.begin, message.end);
final level = message.level;
final color = useColors ? colorOf(level.name) : null;
_checkerLogger.log(level, span.message(message.message, color: color));
final text = '[${message.runtimeType}] ${message.message}';
_checkerLogger.log(level, span.message(text, color: color));
}

void clearLibrary(Uri uri) {}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev_compiler/test/codegen/expect/BenchmarkBase.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Messages from compiling BenchmarkBase.dart
warning: line 63, column 7 of test/codegen/BenchmarkBase.dart: f() requires dynamic invoke
warning: line 63, column 7 of test/codegen/BenchmarkBase.dart: [DynamicInvoke] f() requires dynamic invoke
f();
^^^
10 changes: 5 additions & 5 deletions pkg/dev_compiler/test/codegen/expect/DeltaBlue.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Messages from compiling DeltaBlue.dart
warning: line 63, column 7 of test/codegen/BenchmarkBase.dart: f() requires dynamic invoke
warning: line 63, column 7 of test/codegen/BenchmarkBase.dart: [DynamicInvoke] f() requires dynamic invoke
f();
^^^
info: line 130, column 18 of test/codegen/DeltaBlue.dart: mark (dynamic) will need runtime check to cast to type int
info: line 130, column 18 of test/codegen/DeltaBlue.dart: [DownCast] mark (dynamic) will need runtime check to cast to type int
chooseMethod(mark);
^^^^
info: line 137, column 16 of test/codegen/DeltaBlue.dart: mark (dynamic) will need runtime check to cast to type int
info: line 137, column 16 of test/codegen/DeltaBlue.dart: [DownCast] mark (dynamic) will need runtime check to cast to type int
markInputs(mark);
^^^^
info: line 142, column 37 of test/codegen/DeltaBlue.dart: mark (dynamic) will need runtime check to cast to type int
info: line 142, column 37 of test/codegen/DeltaBlue.dart: [DownCast] mark (dynamic) will need runtime check to cast to type int
if (!planner.addPropagate(this, mark)) print("Cycle encountered");
^^^^
info: line 143, column 16 of test/codegen/DeltaBlue.dart: mark (dynamic) will need runtime check to cast to type int
info: line 143, column 16 of test/codegen/DeltaBlue.dart: [DownCast] mark (dynamic) will need runtime check to cast to type int
out.mark = mark;
^^^^
8 changes: 4 additions & 4 deletions pkg/dev_compiler/test/codegen/expect/cascade.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Messages from compiling cascade.dart
warning: line 16, column 5 of test/codegen/cascade.dart: ..x() requires dynamic invoke
warning: line 16, column 5 of test/codegen/cascade.dart: [DynamicInvoke] ..x() requires dynamic invoke
..x()
^^^^^
warning: line 17, column 5 of test/codegen/cascade.dart: ..x() requires dynamic invoke
warning: line 17, column 5 of test/codegen/cascade.dart: [DynamicInvoke] ..x() requires dynamic invoke
..x();
^^^^^
warning: line 27, column 5 of test/codegen/cascade.dart: ..x() requires dynamic invoke
warning: line 27, column 5 of test/codegen/cascade.dart: [DynamicInvoke] ..x() requires dynamic invoke
..x()
^^^^^
warning: line 28, column 5 of test/codegen/cascade.dart: ..x() requires dynamic invoke
warning: line 28, column 5 of test/codegen/cascade.dart: [DynamicInvoke] ..x() requires dynamic invoke
..x();
^^^^^
8 changes: 4 additions & 4 deletions pkg/dev_compiler/test/codegen/expect/fieldtest.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Messages from compiling fieldtest.dart
warning: line 23, column 9 of test/codegen/fieldtest.dart: a.x requires dynamic invoke
warning: line 23, column 9 of test/codegen/fieldtest.dart: [DynamicInvoke] a.x requires dynamic invoke
print(a.x);
^^^
info: line 24, column 10 of test/codegen/fieldtest.dart: a.x (dynamic) will need runtime check to cast to type int
info: line 24, column 10 of test/codegen/fieldtest.dart: [DownCast] a.x (dynamic) will need runtime check to cast to type int
return a.x;
^^^
warning: line 24, column 10 of test/codegen/fieldtest.dart: a.x requires dynamic invoke
warning: line 24, column 10 of test/codegen/fieldtest.dart: [DynamicInvoke] a.x requires dynamic invoke
return a.x;
^^^
info: line 35, column 7 of test/codegen/fieldtest.dart: value (dynamic) will need runtime check to cast to type int
info: line 35, column 7 of test/codegen/fieldtest.dart: [DownCast] value (dynamic) will need runtime check to cast to type int
y = value;
^^^^^
6 changes: 3 additions & 3 deletions pkg/dev_compiler/test/codegen/expect/methods.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Messages from compiling methods.dart
info: line 14, column 21 of test/codegen/methods.dart: b (num) will need runtime check to cast to type int
info: line 14, column 21 of test/codegen/methods.dart: [DownCast] b (num) will need runtime check to cast to type int
int z([num b]) => b;
^
info: line 19, column 12 of test/codegen/methods.dart: a + b (num) will need runtime check to cast to type int
info: line 19, column 12 of test/codegen/methods.dart: [DownCast] a + b (num) will need runtime check to cast to type int
return a + b;
^^^^^
warning: line 49, column 3 of test/codegen/methods.dart: f.bar("Bar's call method!") requires dynamic invoke
warning: line 49, column 3 of test/codegen/methods.dart: [DynamicInvoke] f.bar("Bar's call method!") requires dynamic invoke
f.bar("Bar's call method!");
^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 changes: 2 additions & 2 deletions pkg/dev_compiler/test/codegen/expect/sunflower.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Messages from compiling sunflower.dart
info: line 20, column 29 of test/codegen/sunflower.dart: querySelector("#slider") (Element) will need runtime check to cast to type InputElement
info: line 20, column 29 of test/codegen/sunflower.dart: [DownCast] querySelector("#slider") (Element) will need runtime check to cast to type InputElement
final InputElement slider = querySelector("#slider");
^^^^^^^^^^^^^^^^^^^^^^^^
info: line 25, column 5 of test/codegen/sunflower.dart: (querySelector("#canvas") as CanvasElement).getContext('2d') (RenderingContext) will need runtime check to cast to type CanvasRenderingContext2D
info: line 25, column 5 of test/codegen/sunflower.dart: [DownCast] (querySelector("#canvas") as CanvasElement).getContext('2d') (RenderingContext) will need runtime check to cast to type CanvasRenderingContext2D
(querySelector("#canvas") as CanvasElement).getContext('2d');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 changes: 6 additions & 6 deletions pkg/dev_compiler/test/dart_codegen/expect/types.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Messages from compiling types.dart
info: line 10, column 6 of test/dart_codegen/types/c.dart: f4(3) (dynamic) will need runtime check to cast to type A
info: line 10, column 6 of test/dart_codegen/types/c.dart: [DownCast] f4(3) (dynamic) will need runtime check to cast to type A
f3(f4(3));
^^^^^
warning: line 11, column 6 of test/dart_codegen/types/c.dart: f4 ((dynamic) → dynamic) will need to be wrapped with a closure of type (A) → A
warning: line 11, column 6 of test/dart_codegen/types/c.dart: [ClosureWrap] f4 ((dynamic) → dynamic) will need to be wrapped with a closure of type (A) → A
f1(f4);
^^
warning: line 12, column 6 of test/dart_codegen/types/c.dart: f3 ((A) → A) will need to be wrapped with a closure of type (dynamic) → dynamic
warning: line 12, column 6 of test/dart_codegen/types/c.dart: [ClosureWrap] f3 ((A) → A) will need to be wrapped with a closure of type (dynamic) → dynamic
f2(f3);
^^
info: line 10, column 14 of test/dart_codegen/types/d.dart: f4("""hello""") (dynamic) will need runtime check to cast to type A
info: line 10, column 14 of test/dart_codegen/types/d.dart: [DownCast] f4("""hello""") (dynamic) will need runtime check to cast to type A
var x = f3(f4("""hello"""));
^^^^^^^^^^^^^^^
warning: line 11, column 14 of test/dart_codegen/types/d.dart: f4 ((dynamic) → dynamic) will need to be wrapped with a closure of type (A) → A
warning: line 11, column 14 of test/dart_codegen/types/d.dart: [ClosureWrap] f4 ((dynamic) → dynamic) will need to be wrapped with a closure of type (A) → A
var y = f1(f4);
^^
warning: line 12, column 14 of test/dart_codegen/types/d.dart: f3 ((A) → A) will need to be wrapped with a closure of type (dynamic) → dynamic
warning: line 12, column 14 of test/dart_codegen/types/d.dart: [ClosureWrap] f3 ((A) → A) will need to be wrapped with a closure of type (dynamic) → dynamic
var z = f2(f3);
^^

0 comments on commit 74476b5

Please sign in to comment.