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

Unified Diff: runtime/lib/mirrors.cc

Issue 212883009: Handle creating ParameterMirrors for the parameters of forwarding constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | runtime/vm/class_finalizer.cc » ('j') | runtime/vm/class_finalizer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index d2427f9b4122ef421af9c4fe58f9f01cbbbe7ed1..3a3d4dce69ecb2390447e156e8e3f91119573867 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -129,11 +129,19 @@ static RawInstance* CreateParameterMirrorList(const Function& func,
const Array& results = Array::Handle(Array::New(non_implicit_param_count));
const Array& args = Array::Handle(Array::New(9));
- // Return for synthetic functions and getters.
- if (func.IsGetterFunction() ||
- func.IsImplicitConstructor() ||
- func.IsImplicitGetterFunction() ||
- func.IsImplicitSetterFunction()) {
+ if (func.IsForwardingConstructor()) {
+ // Forwarding constructors for mixin applications don't have any source to
+ // parse, but they do have parameters. Use the names/types/metadata from
+ // constructor that we are forwarding to. We will probably have to revisit
+ // this when restrictions on constructors in mixins are relaxed.
+ const Function& target = Function::Handle(func.ForwardingTarget());
+ ASSERT(!target.IsNull());
+ return CreateParameterMirrorList(target, owner_mirror);
+ }
+
+ if (func.IsGetterFunction() || func.IsImplicitConstructor()) {
+ // These have no parameters.
+ ASSERT(results.Length() == 0);
return results.raw();
}
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | runtime/vm/class_finalizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698