| Index: lib/src/checker/rules.dart
|
| diff --git a/lib/src/checker/rules.dart b/lib/src/checker/rules.dart
|
| index 78825d586a4c6c39a19ee5dde8d852886760b794..89362aacad59003789f9355bd4bc8aabb7c49685 100644
|
| --- a/lib/src/checker/rules.dart
|
| +++ b/lib/src/checker/rules.dart
|
| @@ -12,29 +12,20 @@ import '../../strong_mode.dart' show StrongModeOptions;
|
| import '../info.dart';
|
| import '../utils.dart' as utils;
|
|
|
| -abstract class TypeRules {
|
| +class TypeRules {
|
| final TypeProvider provider;
|
|
|
| /// Map of fields / properties / methods on Object.
|
| final Map<String, DartType> objectMembers;
|
|
|
| - TypeRules(TypeProvider provider)
|
| - : provider = provider,
|
| - objectMembers = utils.getObjectMemberMap(provider);
|
| -
|
| - bool isSubTypeOf(DartType t1, DartType t2);
|
| - bool isAssignable(DartType t1, DartType t2);
|
| -
|
| - bool isGroundType(DartType t) => true;
|
| - // TODO(vsm): The default implementation is not ignoring the return type,
|
| - // only the restricted override is.
|
| - bool isFunctionSubTypeOf(FunctionType f1, FunctionType f2,
|
| - {bool fuzzyArrows: true, bool ignoreReturn: false}) =>
|
| - isSubTypeOf(f1, f2);
|
| -
|
| - StaticInfo checkAssignment(Expression expr, DartType t);
|
| + final StrongModeOptions options;
|
| + DownwardsInference inferrer;
|
|
|
| - DartType getStaticType(Expression expr) => expr.staticType;
|
| + TypeRules(TypeProvider provider, {this.options})
|
| + : provider = provider,
|
| + objectMembers = utils.getObjectMemberMap(provider) {
|
| + inferrer = new DownwardsInference(this);
|
| + }
|
|
|
| /// Given a type t, if t is an interface type with a call method
|
| /// defined, return the function type for the call method, otherwise
|
| @@ -62,11 +53,6 @@ abstract class TypeRules {
|
| return null;
|
| }
|
|
|
| - DartType elementType(Element e);
|
| -
|
| - bool isDynamicTarget(Expression expr);
|
| - bool isDynamicCall(Expression call);
|
| -
|
| /// Gets the expected return type of the given function [body], either from
|
| /// a normal return/yield, or from a yield*.
|
| DartType getExpectedReturnType(FunctionBody body, {bool yieldStar: false}) {
|
| @@ -119,15 +105,6 @@ abstract class TypeRules {
|
| return null;
|
| }
|
| }
|
| -}
|
| -
|
| -class RestrictedRules extends TypeRules {
|
| - final StrongModeOptions options;
|
| - DownwardsInference inferrer;
|
| -
|
| - RestrictedRules(TypeProvider provider, {this.options}) : super(provider) {
|
| - inferrer = new DownwardsInference(this);
|
| - }
|
|
|
| DartType getStaticType(Expression expr) {
|
| return expr.staticType ?? provider.dynamicType;
|
|
|