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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1706033002: More shared messages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | pkg/dart_messages/bin/publish.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 library dart2js.resolution.members; 5 library dart2js.resolution.members;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show 8 import '../common/names.dart' show
9 Selectors; 9 Selectors;
10 import '../common/resolution.dart' show 10 import '../common/resolution.dart' show
(...skipping 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after
3667 3667
3668 ResolutionResult visitReturn(Return node) { 3668 ResolutionResult visitReturn(Return node) {
3669 Node expression = node.expression; 3669 Node expression = node.expression;
3670 if (expression != null) { 3670 if (expression != null) {
3671 if (enclosingElement.isGenerativeConstructor) { 3671 if (enclosingElement.isGenerativeConstructor) {
3672 // It is a compile-time error if a return statement of the form 3672 // It is a compile-time error if a return statement of the form
3673 // `return e;` appears in a generative constructor. (Dart Language 3673 // `return e;` appears in a generative constructor. (Dart Language
3674 // Specification 13.12.) 3674 // Specification 13.12.)
3675 reporter.reportErrorMessage( 3675 reporter.reportErrorMessage(
3676 expression, 3676 expression,
3677 MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR); 3677 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR);
3678 } else if (!node.isArrowBody && currentAsyncMarker.isYielding) { 3678 } else if (!node.isArrowBody && currentAsyncMarker.isYielding) {
3679 reporter.reportErrorMessage( 3679 reporter.reportErrorMessage(
3680 node, 3680 node,
3681 MessageKind.RETURN_IN_GENERATOR, 3681 MessageKind.RETURN_IN_GENERATOR,
3682 {'modifier': currentAsyncMarker}); 3682 {'modifier': currentAsyncMarker});
3683 } 3683 }
3684 } 3684 }
3685 visit(node.expression); 3685 visit(node.expression);
3686 return const NoneResult(); 3686 return const NoneResult();
3687 } 3687 }
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
4864 } 4864 }
4865 return const NoneResult(); 4865 return const NoneResult();
4866 } 4866 }
4867 } 4867 }
4868 4868
4869 /// Looks up [name] in [scope] and unwraps the result. 4869 /// Looks up [name] in [scope] and unwraps the result.
4870 Element lookupInScope(DiagnosticReporter reporter, Node node, 4870 Element lookupInScope(DiagnosticReporter reporter, Node node,
4871 Scope scope, String name) { 4871 Scope scope, String name) {
4872 return Elements.unwrap(scope.lookup(name), reporter, node); 4872 return Elements.unwrap(scope.lookup(name), reporter, node);
4873 } 4873 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | pkg/dart_messages/bin/publish.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698