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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1647653007: Resolve signature from correct scope class (fix #25609). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip Created 4 years, 11 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 | « no previous file | tests/language/regress_25609_lib1.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 67b3683c453ca9557eef2892b74e9aaf03e32e3a..f97d6dc1856d6ff2f14218787e0716f7c5ff8fb8 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -526,7 +526,13 @@ RawAbstractType* ClassFinalizer::ResolveType(const Class& cls,
ASSERT(type.IsFunctionType());
const Function& signature =
Function::Handle(FunctionType::Cast(type).signature());
- ResolveSignature(cls, signature);
+ const Class& scope_class =
+ Class::Handle(FunctionType::Cast(type).scope_class());
+ if (scope_class.IsTypedefClass()) {
+ ResolveSignature(scope_class, signature);
+ } else {
+ ResolveSignature(cls, signature);
+ }
resolved_type = type.raw();
}
// Mark type as resolved before resolving its type arguments in order to avoid
@@ -1156,7 +1162,13 @@ RawAbstractType* ClassFinalizer::FinalizeType(
if (resolved_type.IsFunctionType()) {
const Function& signature =
Function::Handle(Z, FunctionType::Cast(resolved_type).signature());
- FinalizeSignature(cls, signature);
+ const Class& scope_class =
+ Class::Handle(Z, FunctionType::Cast(resolved_type).scope_class());
+ if (scope_class.IsTypedefClass()) {
+ FinalizeSignature(scope_class, signature);
+ } else {
+ FinalizeSignature(cls, signature);
+ }
}
if (FLAG_trace_type_finalization) {
« no previous file with comments | « no previous file | tests/language/regress_25609_lib1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698