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

Unified Diff: runtime/vm/parser.cc

Issue 1778133002: Enumerate URIs of all types in type errors in order to help the user diagnose (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 9cb7dd44626b9803403ba5409e620abfb7dbc75d..b639e5e60627669e55fa7c205264f3fb18e3c0d7 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -10278,15 +10278,12 @@ AstNode* Parser::ThrowTypeError(TokenPosition type_pos,
type_pos, Integer::ZoneHandle(Z, Integer::New(type_pos.value()))));
// Src value argument.
arguments->Add(new(Z) LiteralNode(type_pos, Object::null_instance()));
- // Dst type name argument.
- arguments->Add(new(Z) LiteralNode(type_pos, Symbols::Malformed()));
+ // Dst type argument.
+ arguments->Add(new(Z) LiteralNode(type_pos, type));
// Dst name argument.
arguments->Add(new(Z) LiteralNode(type_pos, Symbols::Empty()));
- // Malformed type error or malbounded type error.
- const Error& error = Error::Handle(Z, type.error());
- ASSERT(!error.IsNull());
- arguments->Add(new(Z) LiteralNode(type_pos, String::ZoneHandle(Z,
- Symbols::New(error.ToErrorCString()))));
+ // Bound error msg argument.
+ arguments->Add(new(Z) LiteralNode(type_pos, Object::null_instance()));
return MakeStaticCall(Symbols::TypeError(), method_name, arguments);
}
@@ -13288,7 +13285,7 @@ AstNode* Parser::ParseNewOperator(Token::Kind op_kind) {
(la3 == Token::kLT) || (la3 == Token::kPERIOD) || (la3 == Token::kHASH);
LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(Z);
- AbstractType& type = AbstractType::Handle(Z,
+ AbstractType& type = AbstractType::ZoneHandle(Z,
ParseType(ClassFinalizer::kCanonicalizeWellFormed,
allow_deferred_type,
consume_unresolved_prefix,
@@ -13417,7 +13414,7 @@ AstNode* Parser::ParseNewOperator(Token::Kind op_kind) {
NULL); // No existing function.
} else if (constructor.IsRedirectingFactory()) {
ClassFinalizer::ResolveRedirectingFactory(type_class, constructor);
- Type& redirect_type = Type::Handle(Z, constructor.RedirectionType());
+ Type& redirect_type = Type::ZoneHandle(Z, constructor.RedirectionType());
if (!redirect_type.IsMalformedOrMalbounded() &&
!redirect_type.IsInstantiated()) {
// The type arguments of the redirection type are instantiated from the
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698