Skip to content

Commit 08517e1

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Revert "Make TypeSystem.resolveToBound() do what it promised in the documentation."
This reverts commit 7d54324. Reason for revert: forgot to update CHANGELOG Original change's description: > Make TypeSystem.resolveToBound() do what it promised in the documentation. > > OTOH, we don't have TypeSystem.instantiateToBounds(), so I'm not 100% > sure whether the doc is inaccurate, or instantiateToBounds() should be > added. Or even if DartType.resolveToBound() should be used, not the > version from TypeSystem. > > R=​[email protected], [email protected] > > Change-Id: Ied333161d68af40314f4b8e2c3cee3b350d05f7c > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110757 > Reviewed-by: Brian Wilkerson <[email protected]> > Reviewed-by: Paul Berry <[email protected]> > Commit-Queue: Konstantin Shcheglov <[email protected]> [email protected],[email protected],[email protected] Change-Id: I9019fdf8bf1eb78632dc396f99e7a1108e4bc38f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112274 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent c572fbf commit 08517e1

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

pkg/analyzer/lib/src/generated/type_system.dart

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,31 +2633,7 @@ abstract class TypeSystem implements public.TypeSystem {
26332633

26342634
@override
26352635
DartType resolveToBound(DartType type) {
2636-
if (type is TypeParameterTypeImpl) {
2637-
var element = type.element;
2638-
2639-
var bound = element.bound as TypeImpl;
2640-
if (bound == null) {
2641-
return typeProvider.objectType;
2642-
}
2643-
2644-
NullabilitySuffix nullabilitySuffix = type.nullabilitySuffix;
2645-
NullabilitySuffix newNullabilitySuffix;
2646-
if (nullabilitySuffix == NullabilitySuffix.question ||
2647-
bound.nullabilitySuffix == NullabilitySuffix.question) {
2648-
newNullabilitySuffix = NullabilitySuffix.question;
2649-
} else if (nullabilitySuffix == NullabilitySuffix.star ||
2650-
bound.nullabilitySuffix == NullabilitySuffix.star) {
2651-
newNullabilitySuffix = NullabilitySuffix.star;
2652-
} else {
2653-
newNullabilitySuffix = NullabilitySuffix.none;
2654-
}
2655-
2656-
var resolved = resolveToBound(bound) as TypeImpl;
2657-
return resolved.withNullability(newNullabilitySuffix);
2658-
}
2659-
2660-
return type;
2636+
return instantiateToBounds(type);
26612637
}
26622638

26632639
/**

0 commit comments

Comments
 (0)