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

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

Issue 51843005: Emit a compile-time error when using default values in a redirecting factory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Language status changes. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.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
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index cbc31ee2ed7ec69c460043573db688f07e400ac3..dde4159aa2aa4fc05456f1df77fad3525c2f66af 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1084,11 +1084,19 @@ class ResolverTask extends CompilerTask {
}
FunctionSignature resolveSignature(FunctionElement element) {
+ MessageKind defaultValuesError = null;
+ if (element.isFactoryConstructor()) {
+ FunctionExpression body = element.parseNode(compiler);
+ if (body.isRedirectingFactory) {
+ defaultValuesError = MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT;
+ }
+ }
return compiler.withCurrentElement(element, () {
FunctionExpression node =
compiler.parser.measure(() => element.parseNode(compiler));
return measure(() => SignatureResolver.analyze(
- compiler, node.parameters, node.returnType, element));
+ compiler, node.parameters, node.returnType, element,
+ defaultValuesError: defaultValuesError));
});
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698