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

Issue 9665013: Generate a dynamic type error when creating an instance with a bound error. (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 a dynamic type error when creating an instance with a bound error. Committed: https://code.google.com/p/dart/source/detail?r=5250

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -28 lines) Patch
M runtime/lib/error.dart View 1 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 1 5 chunks +13 lines, -6 lines 0 comments Download
M runtime/vm/object.cc View 1 3 chunks +18 lines, -5 lines 0 comments Download
M runtime/vm/parser.cc View 1 6 chunks +24 lines, -7 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 1 chunk +4 lines, -7 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
8 years, 9 months ago (2012-03-09 20:41:02 UTC) #1
srdjan
LGTM https://chromiumcodereview.appspot.com/9665013/diff/1/runtime/lib/error.dart File runtime/lib/error.dart (right): https://chromiumcodereview.appspot.com/9665013/diff/1/runtime/lib/error.dart#newcode41 runtime/lib/error.dart:41: str = str + "malformed type used."; While ...
8 years, 9 months ago (2012-03-09 20:48:28 UTC) #2
regis
8 years, 9 months ago (2012-03-09 21:08:37 UTC) #3
Thanks!

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

https://chromiumcodereview.appspot.com/9665013/diff/1/runtime/lib/error.dart#...
runtime/lib/error.dart:41: str = str + "malformed type used.";
On 2012/03/09 20:48:28, srdjan wrote:
> While you are here: remove String + operator.

Done.

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

https://chromiumcodereview.appspot.com/9665013/diff/1/runtime/vm/class_finali...
runtime/vm/class_finalizer.cc:530: ASSERT(finalization >= kFinalize);
On 2012/03/09 20:48:28, srdjan wrote:
> Would it be better to check if kFinalize || kFinalizeWellFormed ?

Done.

https://chromiumcodereview.appspot.com/9665013/diff/1/runtime/vm/parser.cc
File runtime/vm/parser.cc (right):

https://chromiumcodereview.appspot.com/9665013/diff/1/runtime/vm/parser.cc#ne...
runtime/vm/parser.cc:7351: // when requesting kFinalizeWellFormed type
finalization.
On 2012/03/09 20:48:28, srdjan wrote:
> What if we change the libraries? Can we check somewhere/somehow?

We would need to add debug code here to resolve Map and List  and verify that
they do not declare bounds. It is not worth it, since if this core interfaces
are modified at some time (quite improbable) and someone specifies a type
argument out of bounds, the parser will hit the assert below in checked mode.

Powered by Google App Engine
This is Rietveld 408576698