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

Unified Diff: runtime/vm/object.cc

Issue 10388019: Allow self referencing typedefs (issue 2490). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/class_finalizer.cc ('k') | tests/language/function_type_alias5_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 7399)
+++ runtime/vm/object.cc (working copy)
@@ -2267,7 +2267,7 @@
num_type_params = cls.NumTypeParameters(); // Do not print the full vector.
if (num_type_params > num_args) {
first_type_param_index = 0;
- if (!IsFinalized() || IsBeingFinalized()) {
+ if (!IsFinalized() || IsBeingFinalized() || IsMalformed()) {
// Most probably an illformed type. Do not fill up with "Dynamic",
// but use actual vector.
num_type_params = num_args;
@@ -2282,14 +2282,16 @@
if (cls.IsSignatureClass()) {
// We may be reporting an error about an illformed function type. In that
// case, avoid instantiating the signature, since it may lead to cycles.
- if (!IsFinalized() || IsBeingFinalized()) {
+ if (!IsFinalized() || IsBeingFinalized() || IsMalformed()) {
return class_name.raw();
}
- const Function& signature_function = Function::Handle(
- cls.signature_function());
- // Signature classes have no super type.
- ASSERT(first_type_param_index == 0);
- return signature_function.InstantiatedSignatureFrom(args);
+ if (num_type_params > 0) {
+ const Function& signature_function = Function::Handle(
+ cls.signature_function());
+ // Signature classes have no super type.
+ ASSERT(first_type_param_index == 0);
+ return signature_function.InstantiatedSignatureFrom(args);
+ }
}
} else {
const UnresolvedClass& cls = UnresolvedClass::Handle(unresolved_class());
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/language/function_type_alias5_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698