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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element get currentElement; 8 Element get currentElement;
9 Setlet<Node> get superUses; 9 Setlet<Node> get superUses;
10 10
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 superMember, 1077 superMember,
1078 MessageKind.BAD_ARITY_OVERRIDE_CONT); 1078 MessageKind.BAD_ARITY_OVERRIDE_CONT);
1079 } 1079 }
1080 // TODO(ahe): Check optional parameters. 1080 // TODO(ahe): Check optional parameters.
1081 } 1081 }
1082 } 1082 }
1083 } 1083 }
1084 } 1084 }
1085 1085
1086 FunctionSignature resolveSignature(FunctionElement element) { 1086 FunctionSignature resolveSignature(FunctionElement element) {
1087 MessageKind defaultValuesError = null;
1088 if (element.isFactoryConstructor()) {
1089 FunctionExpression body = element.parseNode(compiler);
1090 if (body.isRedirectingFactory) {
1091 defaultValuesError = MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT;
1092 }
1093 }
1087 return compiler.withCurrentElement(element, () { 1094 return compiler.withCurrentElement(element, () {
1088 FunctionExpression node = 1095 FunctionExpression node =
1089 compiler.parser.measure(() => element.parseNode(compiler)); 1096 compiler.parser.measure(() => element.parseNode(compiler));
1090 return measure(() => SignatureResolver.analyze( 1097 return measure(() => SignatureResolver.analyze(
1091 compiler, node.parameters, node.returnType, element)); 1098 compiler, node.parameters, node.returnType, element,
1099 defaultValuesError: defaultValuesError));
1092 }); 1100 });
1093 } 1101 }
1094 1102
1095 FunctionSignature resolveFunctionExpression(Element element, 1103 FunctionSignature resolveFunctionExpression(Element element,
1096 FunctionExpression node) { 1104 FunctionExpression node) {
1097 return measure(() => SignatureResolver.analyze( 1105 return measure(() => SignatureResolver.analyze(
1098 compiler, node.parameters, node.returnType, element)); 1106 compiler, node.parameters, node.returnType, element));
1099 } 1107 }
1100 1108
1101 TreeElements resolveTypedef(TypedefElementX element) { 1109 TreeElements resolveTypedef(TypedefElementX element) {
(...skipping 3612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 return finishConstructorReference(visit(expression), 4722 return finishConstructorReference(visit(expression),
4715 expression, expression); 4723 expression, expression);
4716 } 4724 }
4717 } 4725 }
4718 4726
4719 /// Looks up [name] in [scope] and unwraps the result. 4727 /// Looks up [name] in [scope] and unwraps the result.
4720 Element lookupInScope(Compiler compiler, Node node, 4728 Element lookupInScope(Compiler compiler, Node node,
4721 Scope scope, String name) { 4729 Scope scope, String name) {
4722 return Elements.unwrap(scope.lookup(name), compiler, node); 4730 return Elements.unwrap(scope.lookup(name), compiler, node);
4723 } 4731 }
OLDNEW
« 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