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

Issue 9615035: Generate dynamic type errors according to spec. (Closed)

Created:
8 years, 9 months ago by regis
Modified:
8 years, 9 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Generate dynamic type errors according to spec. Fix a few bad tests. Turn a couple negative tests in multi-tests. Triage a few co19 failing tests. Still to do: Check bounds of generic types at runtime in checked mode. Stop reporting bounds error in new operator as a compile time error. Committed: https://code.google.com/p/dart/source/detail?r=5064

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+771 lines, -536 lines) Patch
M runtime/lib/error.cc View 1 6 chunks +17 lines, -298 lines 0 comments Download
M runtime/lib/error.dart View 1 1 chunk +7 lines, -4 lines 0 comments Download
M runtime/vm/class_finalizer.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 1 8 chunks +61 lines, -20 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 3 chunks +207 lines, -9 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 8 chunks +34 lines, -23 lines 0 comments Download
M runtime/vm/code_generator_x64.cc View 1 8 chunks +34 lines, -23 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 chunks +9 lines, -2 lines 0 comments Download
M runtime/vm/exceptions.h View 1 2 chunks +23 lines, -0 lines 0 comments Download
M runtime/vm/exceptions.cc View 1 1 chunk +121 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 10 chunks +51 lines, -25 lines 0 comments Download
M runtime/vm/object.cc View 1 21 chunks +119 lines, -37 lines 0 comments Download
M runtime/vm/parser.h View 1 2 chunks +12 lines, -8 lines 0 comments Download
M runtime/vm/parser.cc View 1 11 chunks +49 lines, -19 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 3 chunks +6 lines, -8 lines 0 comments Download
M tests/language/language.status View 1 5 chunks +4 lines, -11 lines 0 comments Download
D tests/language/src/Prefix22NegativeTest.dart View 1 1 chunk +0 lines, -19 lines 0 comments Download
M tests/language/src/Prefix22Test.dart View 1 1 chunk +3 lines, -3 lines 0 comments Download
D tests/language/src/Prefix23NegativeTest.dart View 1 1 chunk +0 lines, -17 lines 0 comments Download
M tests/language/src/Prefix23Test.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/src/TypeVariableBounds2Test.dart View 1 1 chunk +4 lines, -1 line 0 comments Download
M tests/language/src/TypeVariableBoundsTest.dart View 1 3 chunks +4 lines, -4 lines 0 comments Download
M tests/language/src/WrongNumberTypeArgumentsTest.dart View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
It is not as bad as it looks. Some code was moved from error.cc to ...
8 years, 9 months ago (2012-03-06 23:09:27 UTC) #1
srdjan
LGTM with comments & questions. Please test frog and leg. https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/lib/error.dart File runtime/lib/error.dart (right): https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/lib/error.dart#newcode38 ...
8 years, 9 months ago (2012-03-07 00:41:23 UTC) #2
regis
8 years, 9 months ago (2012-03-07 02:22:38 UTC) #3
I tested dartc, frog, frogsh, and leg in release mode. I'll watch the build bots
anyway.

Thanks,
Regis

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/lib/error.dart
File runtime/lib/error.dart (right):

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/lib/error.dart#...
runtime/lib/error.dart:38: str +=
On 2012/03/07 00:41:23, srdjan wrote:
> Do not use the deprecated + String operator.

Done.

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/vm/class_finali...
File runtime/vm/class_finalizer.cc (right):

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/vm/class_finali...
runtime/vm/class_finalizer.cc:176: OS::Print("%s\n",
malformed_error.ToErrorCString());
On 2012/03/07 00:41:23, srdjan wrote:
> Shouldn't this be going to PrintErr?

Done.

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/vm/code_generat...
File runtime/vm/code_generator.cc (right):

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/vm/code_generat...
runtime/vm/code_generator.cc:358: // Arg0: index of the token of the instanceof
test (source location).
On 2012/03/07 00:41:23, srdjan wrote:
> You should be able to get the token from the PcDesc (via DartFrame), I think,
> especially since you need it only when throwing exception.
> Actually, you don't seem to be needing it here at all?

The location is passed to Exceptions::CreateAndThrowTypeError below.

I have added a TODO.

https://chromiumcodereview.appspot.com/9615035/diff/1/runtime/vm/code_generat...
runtime/vm/code_generator.cc:415: // Arg0: index of the token of the assignment
(source location).
On 2012/03/07 00:41:23, srdjan wrote:
> ditto here and below.

Added TODO.

Powered by Google App Engine
This is Rietveld 408576698