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

Side by Side Diff: runtime/vm/class_finalizer.h

Issue 11049038: Change compile-time errors into dynamic errors in instance creation expression (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_CLASS_FINALIZER_H_ 5 #ifndef VM_CLASS_FINALIZER_H_
6 #define VM_CLASS_FINALIZER_H_ 6 #define VM_CLASS_FINALIZER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 10
(...skipping 11 matching lines...) Expand all
22 class Script; 22 class Script;
23 class Type; 23 class Type;
24 class UnresolvedClass; 24 class UnresolvedClass;
25 25
26 // Traverses all pending, unfinalized classes, validates and marks them as 26 // Traverses all pending, unfinalized classes, validates and marks them as
27 // finalized. 27 // finalized.
28 class ClassFinalizer : public AllStatic { 28 class ClassFinalizer : public AllStatic {
29 public: 29 public:
30 // Modes for type resolution and finalization. The ordering is relevant. 30 // Modes for type resolution and finalization. The ordering is relevant.
31 enum FinalizationKind { 31 enum FinalizationKind {
32 kIgnore, // Parsed type is ignored and replaced by Dynamic. 32 kIgnore, // Type is ignored and replaced by Dynamic.
33 kDoNotResolve, // Type resolution is postponed. 33 kDoNotResolve, // Type resolution is postponed.
34 kTryResolve, // Type resolution is attempted, but not required. 34 kTryResolve, // Type resolution is attempted.
35 kFinalize, // Type resolution and type finalization are 35 kFinalize, // Type resolution and type finalization are
36 // required; a malformed type is tolerated. 36 // required; a malformed type is tolerated.
37 kCanonicalize, // Same as kFinalize, but with canonicalization. 37 kCanonicalize, // Same as kFinalize, but with canonicalization.
38 kCanonicalizeWellFormed // Error-free resolution, finalization, and 38 kCanonicalizeForCreation, // Same as kCanonicalize, but do not tolerate
39 // canonicalization are required; a malformed type 39 // wrong number of type arguments.
40 // is not tolerated. 40 kCanonicalizeWellFormed // Error-free resolution, finalization, and
41 // canonicalization are required; a malformed
42 // type is not tolerated.
41 }; 43 };
42 44
43 // Finalize given type while parsing class cls. 45 // Finalize given type while parsing class cls.
44 // Also canonicalize type if applicable. 46 // Also canonicalize type if applicable.
45 static RawAbstractType* FinalizeType(const Class& cls, 47 static RawAbstractType* FinalizeType(const Class& cls,
46 const AbstractType& type, 48 const AbstractType& type,
47 FinalizationKind finalization); 49 FinalizationKind finalization);
48 50
49 // Allocate, finalize, and return a new malformed type as if it was declared 51 // Allocate, finalize, and return a new malformed type as if it was declared
50 // in class cls at the given token position. Build the error message from the 52 // in class cls at the given token position. Build the error message from the
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 static void ReportError(const Error& error); 120 static void ReportError(const Error& error);
119 static void ReportError(const Script& script, 121 static void ReportError(const Script& script,
120 intptr_t token_index, 122 intptr_t token_index,
121 const char* format, ...) PRINTF_ATTRIBUTE(3, 4); 123 const char* format, ...) PRINTF_ATTRIBUTE(3, 4);
122 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); 124 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2);
123 }; 125 };
124 126
125 } // namespace dart 127 } // namespace dart
126 128
127 #endif // VM_CLASS_FINALIZER_H_ 129 #endif // VM_CLASS_FINALIZER_H_
OLDNEW
« 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