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

Unified Diff: runtime/lib/error.dart

Issue 9515011: Add support for malformed types and postpone some related errors from compile (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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: runtime/lib/error.dart
===================================================================
--- runtime/lib/error.dart (revision 4727)
+++ runtime/lib/error.dart (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Errors are created and thrown by DartVM only.
@@ -29,15 +29,21 @@
static _throwNew(int location,
Object src_value,
String dst_type_name,
- String dst_name)
+ String dst_name,
+ String malformed_error)
native "TypeError_throwNew";
String toString() {
- return "'$url': Failed type check: line $line pos $column: " +
- "type '$srcType' is not assignable to type '$dstType' of '$dstName'.";
+ if (malformedError != null) {
+ return malformedError;
+ } else {
+ return "'$url': Failed type check: line $line pos $column: " +
srdjan 2012/02/29 00:15:54 no else is needed
regis 2012/02/29 02:10:01 Done.
+ "type '$srcType' is not assignable to type '$dstType' of '$dstName'.";
+ }
}
final String srcType;
final String dstType;
final String dstName;
+ final String malformedError;
}
class FallThroughError {
@@ -70,7 +76,7 @@
"pos $column\n$failedResolutionLine\n";
static _throwNew(int token_pos) native "StaticResolutionException_throwNew";
-
+
final String failedResolutionLine;
final String url;
final int line;

Powered by Google App Engine
This is Rietveld 408576698