@@ -36,15 +36,12 @@ abstract class DartType {
3636 DartType get unaliased => this ;
3737
3838 /// Is `true` if this type is a top type.
39- // TODO(fishythefish): Update this for normalization .
39+ // TODO(fishythefish): Update this for NNBD .
4040 bool get isTop => false ;
4141
42- /// Is `true` if this type has no non-dynamic type arguments.
42+ /// Is `true` if this type has no non-top type arguments.
4343 bool get treatAsRaw => true ;
4444
45- /// Is `true` if this type should be treated as the dynamic type.
46- bool get treatAsDynamic => false ;
47-
4845 /// Whether this type contains a type variable.
4946 bool get containsTypeVariables => false ;
5047
@@ -248,7 +245,7 @@ class InterfaceType extends DartType {
248245 @override
249246 bool get treatAsRaw {
250247 for (DartType type in typeArguments) {
251- if (! type.treatAsDynamic ) return false ;
248+ if (! type.isTop ) return false ;
252249 }
253250 return true ;
254251 }
@@ -310,7 +307,7 @@ class TypedefType extends DartType {
310307 @override
311308 bool get treatAsRaw {
312309 for (DartType type in typeArguments) {
313- if (! type.treatAsDynamic ) return false ;
310+ if (! type.isTop ) return false ;
314311 }
315312 return true ;
316313 }
@@ -482,9 +479,6 @@ class DynamicType extends DartType {
482479 @override
483480 bool get isTop => true ;
484481
485- @override
486- bool get treatAsDynamic => true ;
487-
488482 @override
489483 R accept <R , A >(DartTypeVisitor <R , A > visitor, A argument) =>
490484 visitor.visitDynamicType (this , argument);
@@ -506,9 +500,6 @@ class ErasedType extends DartType {
506500 @override
507501 bool get isTop => true ;
508502
509- @override
510- bool get treatAsDynamic => true ;
511-
512503 @override
513504 R accept <R , A >(DartTypeVisitor <R , A > visitor, A argument) =>
514505 visitor.visitErasedType (this , argument);
@@ -1741,13 +1732,13 @@ abstract class MoreSpecificVisitor<T extends DartType>
17411732 if (identical (t, s) ||
17421733 t is AnyType ||
17431734 s is AnyType ||
1744- s.treatAsDynamic ||
1735+ s.isTop ||
17451736 s is VoidType ||
17461737 s == commonElements.objectType ||
17471738 t == commonElements.nullType) {
17481739 return true ;
17491740 }
1750- if (t.treatAsDynamic ) {
1741+ if (t.isTop ) {
17511742 return false ;
17521743 }
17531744
@@ -1764,7 +1755,7 @@ abstract class MoreSpecificVisitor<T extends DartType>
17641755
17651756 @override
17661757 bool invalidFunctionReturnTypes (T t, T s) {
1767- if (s.treatAsDynamic && t is VoidType ) return true ;
1758+ if (s.isTop && t is VoidType ) return true ;
17681759 return s is ! VoidType && ! isMoreSpecific (t, s);
17691760 }
17701761
0 commit comments