| Index: pkg/analyzer/lib/src/generated/constant.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
|
| index 2aab6ed18ab92a960a2d81df113bd22a7508451a..ace6cb5e5f0380441ab1e04f4ece0c8775c978b9 100644
|
| --- a/pkg/analyzer/lib/src/generated/constant.dart
|
| +++ b/pkg/analyzer/lib/src/generated/constant.dart
|
| @@ -57,9 +57,6 @@ class BoolState extends InstanceState {
|
| BoolState(this.value);
|
|
|
| @override
|
| - bool get hasExactValue => true;
|
| -
|
| - @override
|
| int get hashCode => value == null ? 0 : (value ? 2 : 3);
|
|
|
| @override
|
| @@ -1972,33 +1969,6 @@ class ConstantVisitor extends UnifyingAstVisitor<DartObjectImpl> {
|
| */
|
| abstract class DartObject {
|
| /**
|
| - * Return the boolean value of this object, or `null` if either the value of
|
| - * this object is not known or this object is not of type 'bool'.
|
| - *
|
| - * Deprecated. Use [toBoolValue].
|
| - */
|
| - @deprecated
|
| - bool get boolValue;
|
| -
|
| - /**
|
| - * Return the floating point value of this object, or `null` if either the
|
| - * value of this object is not known or this object is not of type 'double'.
|
| - *
|
| - * Deprecated. Use [toDoubleValue].
|
| - */
|
| - @deprecated
|
| - double get doubleValue;
|
| -
|
| - /**
|
| - * Return `true` if this object's value can be represented exactly.
|
| - *
|
| - * Deprecated. The semantics of this method were not clear. One semantic is
|
| - * covered by [hasKnownValue].
|
| - */
|
| - @deprecated
|
| - bool get hasExactValue;
|
| -
|
| - /**
|
| * Return `true` if the value of the object being represented is known.
|
| *
|
| * This method will return `false` if
|
| @@ -2017,45 +1987,11 @@ abstract class DartObject {
|
| bool get hasKnownValue;
|
|
|
| /**
|
| - * Return the integer value of this object, or `null` if either the value of
|
| - * this object is not known or this object is not of type 'int'.
|
| - *
|
| - * Deprecated. Use [toIntValue].
|
| - */
|
| - @deprecated
|
| - int get intValue;
|
| -
|
| - /**
|
| - * Return `true` if this object represents the value 'false'.
|
| - *
|
| - * Deprecated. Use `object.toBoolValue() == false`.
|
| - */
|
| - @deprecated
|
| - bool get isFalse;
|
| -
|
| - /**
|
| * Return `true` if the object being represented represents the value 'null'.
|
| */
|
| bool get isNull;
|
|
|
| /**
|
| - * Return `true` if this object represents the value 'true'.
|
| - *
|
| - * Deprecated. Use `object.toBoolValue() == true`.
|
| - */
|
| - @deprecated
|
| - bool get isTrue;
|
| -
|
| - /**
|
| - * Return the string value of this object, or `null` if either the value of
|
| - * this object is not known or this object is not of type 'String'.
|
| - *
|
| - * Deprecated. Use [toStringValue].
|
| - */
|
| - @deprecated
|
| - String get stringValue;
|
| -
|
| - /**
|
| * Return a representation of the type of the object being represented.
|
| *
|
| * For values resulting from the invocation of a 'const' constructor, this
|
| @@ -2080,16 +2016,6 @@ abstract class DartObject {
|
| ParameterizedType get type;
|
|
|
| /**
|
| - * Return this object's value if it can be represented exactly, or `null` if
|
| - * either the value cannot be represented exactly or if the value is `null`.
|
| - * Clients should use `hasExactValue` to distinguish between these two cases.
|
| - *
|
| - * Deprecated. Use one of the `isXValue()` methods.
|
| - */
|
| - @deprecated
|
| - Object get value;
|
| -
|
| - /**
|
| * Return a representation of the value of the field with the given [name].
|
| *
|
| * Return `null` if either the object being represented does not have a field
|
| @@ -2566,30 +2492,14 @@ class DartObjectImpl implements DartObject {
|
| return new DartObjectImpl(type, GenericState.UNKNOWN_VALUE);
|
| }
|
|
|
| - @deprecated
|
| - @override
|
| - bool get boolValue => toBoolValue();
|
| -
|
| - @deprecated
|
| - @override
|
| - double get doubleValue => toDoubleValue();
|
| -
|
| HashMap<String, DartObjectImpl> get fields => _state.fields;
|
|
|
| - @deprecated
|
| - @override
|
| - bool get hasExactValue => _state.hasExactValue;
|
| -
|
| @override
|
| int get hashCode => JenkinsSmiHash.hash2(type.hashCode, _state.hashCode);
|
|
|
| @override
|
| bool get hasKnownValue => !_state.isUnknown;
|
|
|
| - @deprecated
|
| - @override
|
| - int get intValue => toIntValue();
|
| -
|
| /**
|
| * Return `true` if this object represents an object whose type is 'bool'.
|
| */
|
| @@ -2601,18 +2511,9 @@ class DartObjectImpl implements DartObject {
|
| */
|
| bool get isBoolNumStringOrNull => _state.isBoolNumStringOrNull;
|
|
|
| - @deprecated
|
| - @override
|
| - bool get isFalse => toBoolValue() == false;
|
| -
|
| @override
|
| bool get isNull => _state is NullState;
|
|
|
| - @deprecated
|
| - @override
|
| - bool get isTrue =>
|
| - _state is BoolState && identical((_state as BoolState).value, true);
|
| -
|
| /**
|
| * Return `true` if this object represents an unknown value.
|
| */
|
| @@ -2624,14 +2525,6 @@ class DartObjectImpl implements DartObject {
|
| */
|
| bool get isUserDefinedObject => _state is GenericState;
|
|
|
| - @deprecated
|
| - @override
|
| - String get stringValue => toStringValue();
|
| -
|
| - @deprecated
|
| - @override
|
| - Object get value => _state.value;
|
| -
|
| @override
|
| bool operator ==(Object object) {
|
| if (object is! DartObjectImpl) {
|
| @@ -3132,7 +3025,7 @@ class DartObjectImpl implements DartObject {
|
| @override
|
| DartType toTypeValue() {
|
| if (_state is TypeState) {
|
| - Element element = (_state as TypeState).value;
|
| + Element element = (_state as TypeState)._element;
|
| if (element is TypeDefiningElement) {
|
| return element.type;
|
| }
|
| @@ -3237,9 +3130,6 @@ class DoubleState extends NumState {
|
| DoubleState(this.value);
|
|
|
| @override
|
| - bool get hasExactValue => true;
|
| -
|
| - @override
|
| int get hashCode => value == null ? 0 : value.hashCode;
|
|
|
| @override
|
| @@ -3814,14 +3704,6 @@ class EvaluationResultImpl {
|
| this._errors = errors == null ? <AnalysisError>[] : errors;
|
| }
|
|
|
| - @deprecated // Use new EvaluationResultImpl(value)
|
| - EvaluationResultImpl.con1(this.value) {
|
| - this._errors = new List<AnalysisError>(0);
|
| - }
|
| -
|
| - @deprecated // Use new EvaluationResultImpl(value, errors)
|
| - EvaluationResultImpl.con2(this.value, List<AnalysisError> this._errors);
|
| -
|
| List<AnalysisError> get errors => _errors;
|
|
|
| bool equalValues(TypeProvider typeProvider, EvaluationResultImpl result) {
|
| @@ -4018,11 +3900,6 @@ abstract class InstanceState {
|
| HashMap<String, DartObjectImpl> get fields => null;
|
|
|
| /**
|
| - * Return `true` if this object's value can be represented exactly.
|
| - */
|
| - bool get hasExactValue => false;
|
| -
|
| - /**
|
| * Return `true` if this object represents an object whose type is 'bool'.
|
| */
|
| bool get isBool => false;
|
| @@ -4044,13 +3921,6 @@ abstract class InstanceState {
|
| String get typeName;
|
|
|
| /**
|
| - * Return this object's value if it can be represented exactly, or `null` if
|
| - * either the value cannot be represented exactly or if the value is `null`.
|
| - * Clients should use [hasExactValue] to distinguish between these two cases.
|
| - */
|
| - Object get value => null;
|
| -
|
| - /**
|
| * Return the result of invoking the '+' operator on this object with the
|
| * [rightOperand].
|
| *
|
| @@ -4445,9 +4315,6 @@ class IntState extends NumState {
|
| IntState(this.value);
|
|
|
| @override
|
| - bool get hasExactValue => true;
|
| -
|
| - @override
|
| int get hashCode => value == null ? 0 : value.hashCode;
|
|
|
| @override
|
| @@ -4904,17 +4771,6 @@ class ListState extends InstanceState {
|
| ListState(this._elements);
|
|
|
| @override
|
| - bool get hasExactValue {
|
| - int count = _elements.length;
|
| - for (int i = 0; i < count; i++) {
|
| - if (!_elements[i].hasExactValue) {
|
| - return false;
|
| - }
|
| - }
|
| - return true;
|
| - }
|
| -
|
| - @override
|
| int get hashCode {
|
| int value = 0;
|
| int count = _elements.length;
|
| @@ -4928,20 +4784,6 @@ class ListState extends InstanceState {
|
| String get typeName => "List";
|
|
|
| @override
|
| - List<Object> get value {
|
| - int count = _elements.length;
|
| - List<Object> result = new List<Object>(count);
|
| - for (int i = 0; i < count; i++) {
|
| - DartObjectImpl element = _elements[i];
|
| - if (!element.hasExactValue) {
|
| - return null;
|
| - }
|
| - result[i] = element.value;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| bool operator ==(Object object) {
|
| if (object is! ListState) {
|
| return false;
|
| @@ -5012,16 +4854,6 @@ class MapState extends InstanceState {
|
| MapState(this._entries);
|
|
|
| @override
|
| - bool get hasExactValue {
|
| - for (DartObjectImpl key in _entries.keys) {
|
| - if (!key.hasExactValue || !_entries[key].hasExactValue) {
|
| - return false;
|
| - }
|
| - }
|
| - return true;
|
| - }
|
| -
|
| - @override
|
| int get hashCode {
|
| int value = 0;
|
| for (DartObjectImpl key in _entries.keys.toSet()) {
|
| @@ -5034,19 +4866,6 @@ class MapState extends InstanceState {
|
| String get typeName => "Map";
|
|
|
| @override
|
| - Map<Object, Object> get value {
|
| - HashMap<Object, Object> result = new HashMap<Object, Object>();
|
| - for (DartObjectImpl key in _entries.keys) {
|
| - DartObjectImpl value = _entries[key];
|
| - if (!key.hasExactValue || !value.hasExactValue) {
|
| - return null;
|
| - }
|
| - result[key.value] = value.value;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| bool operator ==(Object object) {
|
| if (object is! MapState) {
|
| return false;
|
| @@ -5116,9 +4935,6 @@ class NullState extends InstanceState {
|
| static NullState NULL_STATE = new NullState();
|
|
|
| @override
|
| - bool get hasExactValue => true;
|
| -
|
| - @override
|
| int get hashCode => 0;
|
|
|
| @override
|
| @@ -5375,9 +5191,6 @@ class StringState extends InstanceState {
|
| StringState(this.value);
|
|
|
| @override
|
| - bool get hasExactValue => true;
|
| -
|
| - @override
|
| int get hashCode => value == null ? 0 : value.hashCode;
|
|
|
| @override
|
| @@ -5463,9 +5276,6 @@ class SymbolState extends InstanceState {
|
| SymbolState(this.value);
|
|
|
| @override
|
| - bool get hasExactValue => true;
|
| -
|
| - @override
|
| int get hashCode => value == null ? 0 : value.hashCode;
|
|
|
| @override
|
| @@ -5531,9 +5341,6 @@ class TypeState extends InstanceState {
|
| String get typeName => "Type";
|
|
|
| @override
|
| - Element get value => _element;
|
| -
|
| - @override
|
| bool operator ==(Object object) =>
|
| object is TypeState && (_element == object._element);
|
|
|
|
|