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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 15712002: Specialize the return type of a factory constructor to be the enclosing type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | tests/language/factory_return_type_checked_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/resolution/members.dart (revision 22988)
+++ sdk/lib/_internal/compiler/implementation/resolution/members.dart (working copy)
@@ -3743,7 +3743,9 @@
requiredParameterCount = parametersBuilder.length;
parameters = parametersBuilder.toLink();
}
- DartType returnType = compiler.resolveReturnType(element, returnNode);
+ DartType returnType = element.isFactoryConstructor()
+ ? element.getEnclosingClass().computeType(compiler)
+ : compiler.resolveReturnType(element, returnNode);
if (element.isSetter() && (requiredParameterCount != 1 ||
visitor.optionalParameterCount != 0)) {
// If there are no formal parameters, we already reported an error above.
« no previous file with comments | « no previous file | tests/language/factory_return_type_checked_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698