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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1004353006: Allow "dynamic" as a constant value in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.constant; 8 library engine.constant;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 } 1621 }
1622 } else if (element is ExecutableElement) { 1622 } else if (element is ExecutableElement) {
1623 ExecutableElement function = element; 1623 ExecutableElement function = element;
1624 if (function.isStatic) { 1624 if (function.isStatic) {
1625 ParameterizedType functionType = function.type; 1625 ParameterizedType functionType = function.type;
1626 if (functionType == null) { 1626 if (functionType == null) {
1627 functionType = _typeProvider.functionType; 1627 functionType = _typeProvider.functionType;
1628 } 1628 }
1629 return new DartObjectImpl(functionType, new FunctionState(function)); 1629 return new DartObjectImpl(functionType, new FunctionState(function));
1630 } 1630 }
1631 } else if (element is ClassElement || element is FunctionTypeAliasElement) { 1631 } else if (element is ClassElement ||
1632 element is FunctionTypeAliasElement ||
1633 element is DynamicElementImpl) {
1632 return new DartObjectImpl(_typeProvider.typeType, new TypeState(element)); 1634 return new DartObjectImpl(_typeProvider.typeType, new TypeState(element));
1633 } 1635 }
1634 // TODO(brianwilkerson) Figure out which error to report. 1636 // TODO(brianwilkerson) Figure out which error to report.
1635 _error(node, null); 1637 _error(node, null);
1636 return null; 1638 return null;
1637 } 1639 }
1638 1640
1639 DartObjectImpl _validWithUnknownValue(InterfaceType type) { 1641 DartObjectImpl _validWithUnknownValue(InterfaceType type) {
1640 if (type.element.library.isDartCore) { 1642 if (type.element.library.isDartCore) {
1641 String typeName = type.name; 1643 String typeName = type.name;
(...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after
5020 */ 5022 */
5021 TypeState(this._element); 5023 TypeState(this._element);
5022 5024
5023 @override 5025 @override
5024 int get hashCode => _element == null ? 0 : _element.hashCode; 5026 int get hashCode => _element == null ? 0 : _element.hashCode;
5025 5027
5026 @override 5028 @override
5027 String get typeName => "Type"; 5029 String get typeName => "Type";
5028 5030
5029 @override 5031 @override
5032 Element get value => _element;
5033
5034 @override
5030 bool operator ==(Object object) => 5035 bool operator ==(Object object) =>
5031 object is TypeState && (_element == object._element); 5036 object is TypeState && (_element == object._element);
5032 5037
5033 @override 5038 @override
5034 StringState convertToString() { 5039 StringState convertToString() {
5035 if (_element == null) { 5040 if (_element == null) {
5036 return StringState.UNKNOWN_VALUE; 5041 return StringState.UNKNOWN_VALUE;
5037 } 5042 }
5038 return new StringState(_element.name); 5043 return new StringState(_element.name);
5039 } 5044 }
(...skipping 17 matching lines...) Expand all
5057 return BoolState.from(_element == rightElement); 5062 return BoolState.from(_element == rightElement);
5058 } else if (rightOperand is DynamicState) { 5063 } else if (rightOperand is DynamicState) {
5059 return BoolState.UNKNOWN_VALUE; 5064 return BoolState.UNKNOWN_VALUE;
5060 } 5065 }
5061 return BoolState.FALSE_STATE; 5066 return BoolState.FALSE_STATE;
5062 } 5067 }
5063 5068
5064 @override 5069 @override
5065 String toString() => _element == null ? "-unknown-" : _element.name; 5070 String toString() => _element == null ? "-unknown-" : _element.name;
5066 } 5071 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698