| Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| index 34530f004eb136f67a48e468486fb151205de897..5f089988e9c1567dae421fa306c288d335f4a163 100644
|
| --- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| +++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| @@ -17,6 +17,7 @@ import 'package:analyzer/src/dart/element/type.dart';
|
| import 'package:analyzer/src/generated/java_engine.dart';
|
| import 'package:analyzer/src/generated/resolver.dart';
|
| import 'package:analyzer/src/generated/utilities_dart.dart';
|
| +import 'package:analyzer/src/task/strong/checker.dart' show getDefiniteType;
|
|
|
| /**
|
| * Instances of the class `StaticTypeAnalyzer` perform two type-related tasks. First, they
|
| @@ -1423,8 +1424,8 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
|
| */
|
| void _analyzeLeastUpperBound(
|
| Expression node, Expression expr1, Expression expr2) {
|
| - DartType staticType1 = _getStaticType(expr1);
|
| - DartType staticType2 = _getStaticType(expr2);
|
| + DartType staticType1 = _getDefiniteType(expr1);
|
| + DartType staticType2 = _getDefiniteType(expr2);
|
| if (staticType1 == null) {
|
| // TODO(brianwilkerson) Determine whether this can still happen.
|
| staticType1 = _dynamicType;
|
| @@ -1653,6 +1654,17 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
|
| }
|
|
|
| /**
|
| + * Gets the definite type of expression, which can be used in cases where
|
| + * the most precise type is desired, for example computing the least upper
|
| + * bound.
|
| + *
|
| + * See [getDefiniteType] for more information. Without strong mode, this is
|
| + * equivalent to [_getStaticType].
|
| + */
|
| + DartType _getDefiniteType(Expression expr) =>
|
| + getDefiniteType(expr, _typeSystem, _typeProvider);
|
| +
|
| + /**
|
| * If the given element name can be mapped to the name of a class defined within the given
|
| * library, return the type specified by the argument.
|
| *
|
|
|