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

Unified Diff: runtime/lib/error.dart

Issue 9615035: Generate dynamic type errors according to spec. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 5060)
+++ runtime/lib/error.dart (working copy)
@@ -33,11 +33,14 @@
String malformed_error)
native "TypeError_throwNew";
String toString() {
- if (malformedError != null) {
- return malformedError;
+ String str = (malformedError != null) ? malformedError : "";
+ if ((dstName != null) && (dstName.length > 0)) {
+ str +=
srdjan 2012/03/07 00:41:23 Do not use the deprecated + String operator.
regis 2012/03/07 02:22:38 Done.
+ "type '$srcType' is not assignable to type '$dstType' of '$dstName'.";
+ } else {
+ str += "malformed type used in type test.";
}
- return "'$url': Failed type check: line $line pos $column: " +
- "type '$srcType' is not assignable to type '$dstType' of '$dstName'.";
+ return str;
}
final String srcType;
final String dstType;

Powered by Google App Engine
This is Rietveld 408576698