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

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

Issue 1449343003: Handle prefix as expression in SendSet. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/semantic_visitor_test_send_data.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 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after
3008 } 3008 }
3009 if (element.isClass) { 3009 if (element.isClass) {
3010 // `C = b`, `C++`, or 'C += b` where 'C' is a class. 3010 // `C = b`, `C++`, or 'C += b` where 'C' is a class.
3011 return handleClassTypeLiteralUpdate(node, name, element); 3011 return handleClassTypeLiteralUpdate(node, name, element);
3012 } else if (element.isTypedef) { 3012 } else if (element.isTypedef) {
3013 // `C = b`, `C++`, or 'C += b` where 'F' is a typedef. 3013 // `C = b`, `C++`, or 'C += b` where 'F' is a typedef.
3014 return handleTypedefTypeLiteralUpdate(node, name, element); 3014 return handleTypedefTypeLiteralUpdate(node, name, element);
3015 } else if (element.isTypeVariable) { 3015 } else if (element.isTypeVariable) {
3016 // `T = b`, `T++`, or 'T += b` where 'T' is a type variable. 3016 // `T = b`, `T++`, or 'T += b` where 'T' is a type variable.
3017 return handleTypeVariableTypeLiteralUpdate(node, name, element); 3017 return handleTypeVariableTypeLiteralUpdate(node, name, element);
3018 } else if (element.isPrefix) {
3019 // `p = b` where `p` is a prefix.
3020 ErroneousElement error = reportAndCreateErroneousElement(
3021 node,
3022 name.text,
3023 MessageKind.PREFIX_AS_EXPRESSION,
3024 {'prefix': name},
3025 isError: true);
3026 registry.registerFeature(Feature.COMPILE_TIME_ERROR);
3027 return handleUpdate(
3028 node, name, new StaticAccess.invalid(error));
3018 } else if (element.isLocal) { 3029 } else if (element.isLocal) {
3019 return handleLocalUpdate(node, name, element); 3030 return handleLocalUpdate(node, name, element);
3020 } else if (element.isStatic || element.isTopLevel) { 3031 } else if (element.isStatic || element.isTopLevel) {
3021 return handleStaticOrTopLevelUpdate(node, name, element); 3032 return handleStaticOrTopLevelUpdate(node, name, element);
3022 } 3033 }
3023 return reporter.internalError(node, "Unexpected resolved send: $element"); 3034 return reporter.internalError(node, "Unexpected resolved send: $element");
3024 } 3035 }
3025 3036
3026 /// Handle an unqualified [Send], that is where the `node.receiver` is null, 3037 /// Handle an unqualified [Send], that is where the `node.receiver` is null,
3027 /// like `a`, `a()`, `this()`, `assert()`, and `(){}()`. 3038 /// like `a`, `a()`, `this()`, `assert()`, and `(){}()`.
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after
4831 } 4842 }
4832 return const NoneResult(); 4843 return const NoneResult();
4833 } 4844 }
4834 } 4845 }
4835 4846
4836 /// Looks up [name] in [scope] and unwraps the result. 4847 /// Looks up [name] in [scope] and unwraps the result.
4837 Element lookupInScope(DiagnosticReporter reporter, Node node, 4848 Element lookupInScope(DiagnosticReporter reporter, Node node,
4838 Scope scope, String name) { 4849 Scope scope, String name) {
4839 return Elements.unwrap(scope.lookup(name), reporter, node); 4850 return Elements.unwrap(scope.lookup(name), reporter, node);
4840 } 4851 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/semantic_visitor_test_send_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698