[dart2js] Remove redundant check for Object when printing bounds.

Change-Id: I7e8190ac9d0095cf1bb225f94184eceba00ba887
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145308
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
This commit is contained in:
Mayank Patke 2020-04-30 00:36:28 +00:00 committed by commit-bot@chromium.org
parent cde8098c97
commit 94c81a137b
3 changed files with 3 additions and 6 deletions

View file

@ -1664,8 +1664,7 @@ class _DartTypeToStringVisitor extends DartTypeVisitor<void, void> {
needsComma = _comma(needsComma);
_visit(typeVariable);
DartType bound = typeVariable.bound;
if (!bound._isTop(_useLegacySubtyping) &&
(!_useLegacySubtyping || !bound.isObject)) {
if (!bound._isTop(_useLegacySubtyping)) {
_token(' extends ');
_visit(bound);
}

View file

@ -1156,8 +1156,7 @@ String _functionRtiToString(Rti functionType, List<String> genericContext,
typeParametersText += typeSep;
typeParametersText += genericContext[genericContext.length - 1 - i];
Rti boundRti = _castToRti(_Utils.arrayAt(bounds, i));
if (!isTopType(boundRti) &&
(!JS_GET_FLAG('LEGACY') || !isObjectType(boundRti))) {
if (!isTopType(boundRti)) {
typeParametersText +=
' extends ' + _rtiToString(boundRti, genericContext);
}

View file

@ -1253,8 +1253,7 @@ String _functionRtiToString(Rti functionType, List<String>? genericContext,
typeParametersText += typeSep;
typeParametersText += genericContext[genericContext.length - 1 - i];
Rti boundRti = _Utils.asRti(_Utils.arrayAt(bounds, i));
if (!isTopType(boundRti) &&
(!JS_GET_FLAG('LEGACY') || !isObjectType(boundRti))) {
if (!isTopType(boundRti)) {
typeParametersText +=
' extends ' + _rtiToString(boundRti, genericContext);
}