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

Unified Diff: runtime/vm/class_finalizer.h

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
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.h
===================================================================
--- runtime/vm/class_finalizer.h (revision 4731)
+++ runtime/vm/class_finalizer.h (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.
@@ -41,11 +41,31 @@
AbstractType* interface,
AbstractType* conflicting);
+ // Modes for type resolution and finalization. The ordering is relevant.
+ enum FinalizationKind {
+ kIgnore, // Parsed type is ignored and replaced by Dynamic.
+ kDoNotResolve, // Type resolution is postponed.
+ kTryResolve, // Type resolution is attempted, but not required.
+ kFinalize, // Type resolution and type finalization are required.
+ // A malformed type is tolerated.
+ kFinalizeWellFormed // Error-free resolution and finalization are required.
+ // A malformed type is not tolerated.
+ };
+
// Finalize given type while parsing class cls.
// Also canonicalize type if applicable.
static RawAbstractType* FinalizeType(const Class& cls,
- const AbstractType& type);
+ const AbstractType& type,
+ FinalizationKind finalization);
+ // Replace the malformed type with Dynamic and, depending on the given type
+ // finalization mode and execution mode, mark the type as malformed or report
+ // a compile time error.
+ static void FinalizeMalformedType(const Class& cls,
+ const Type& type,
+ FinalizationKind finalization,
+ const char* format, ...);
+
// Pending classes are classes that need to be finalized.
static void AddPendingClasses(const GrowableArray<const Class*>& classes);
@@ -79,8 +99,11 @@
static void ResolveInterfaces(const Class& cls,
GrowableArray<const Class*>* visited);
static void FinalizeTypeArguments(const Class& cls,
- const AbstractTypeArguments& arguments);
- static void ResolveType(const Class& cls, const AbstractType& type);
+ const AbstractTypeArguments& arguments,
+ FinalizationKind finalization);
+ static void ResolveType(const Class& cls,
+ const AbstractType& type,
+ FinalizationKind finalization);
static void ResolveAndFinalizeUpperBounds(const Class& cls);
static void ResolveAndFinalizeSignature(const Class& cls,
const Function& function);
@@ -89,13 +112,11 @@
static void VerifyClassImplements(const Class& cls);
static void CollectInterfaces(const Class& cls,
GrowableArray<const Class*>* interfaces);
+ static void ReportError(const Error& error);
static void ReportError(const Script& script,
intptr_t token_index,
const char* format, ...);
static void ReportError(const char* format, ...);
- static void ReportWarning(const Script& script,
- intptr_t token_index,
- const char* format, ...);
};
} // namespace dart
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698