| Index: sdk/lib/_internal/compiler/implementation/dart_types.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
|
| index ff98bd457eed8c662265de424075c0ed40e88e9d..b6d3234f3258d9d6ba55e8a303bb6028029209d4 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
|
| @@ -1121,12 +1121,16 @@ class MoreSpecificVisitor extends AbstractTypeRelation {
|
| : super(compiler, dynamicType, voidType);
|
|
|
| bool isMoreSpecific(DartType t, DartType s) {
|
| - if (identical(t, s) ||
|
| - t.treatAsDynamic ||
|
| - identical(s.element, compiler.objectClass) ||
|
| + if (identical(t, s) || s.treatAsDynamic ||
|
| identical(t.element, compiler.nullClass)) {
|
| return true;
|
| }
|
| + if (t.treatAsDynamic) {
|
| + return false;
|
| + }
|
| + if (identical(s.element, compiler.objectClass)) {
|
| + return true;
|
| + }
|
| t = t.unalias(compiler);
|
| s = s.unalias(compiler);
|
|
|
| @@ -1138,6 +1142,7 @@ class MoreSpecificVisitor extends AbstractTypeRelation {
|
| }
|
|
|
| bool invalidFunctionReturnTypes(DartType t, DartType s) {
|
| + if (s.treatAsDynamic && t.isVoid) return true;
|
| return !s.isVoid && !isMoreSpecific(t, s);
|
| }
|
|
|
| @@ -1161,7 +1166,7 @@ class SubtypeVisitor extends MoreSpecificVisitor {
|
| : super(compiler, dynamicType, voidType);
|
|
|
| bool isSubtype(DartType t, DartType s) {
|
| - return s.treatAsDynamic || isMoreSpecific(t, s);
|
| + return t.treatAsDynamic || isMoreSpecific(t, s);
|
| }
|
|
|
| bool isAssignable(DartType t, DartType s) {
|
|
|