Skip to content

Commit 2f3b0bd

Browse files
nshahanCommit Queue
authored andcommitted
[dart2js, ddc] Replace calls to _rtiToString()
Using the public version encapsulates the `genericContext` argument as an implementation detail of `_rtiToString()`. Change-Id: I27f20d4d35a27e69badcb7be4552860043590f95 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417103 Reviewed-by: Mayank Patke <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent fa12123 commit 2f3b0bd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

sdk/lib/_internal/js_shared/lib/rti.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ Rti _instanceType(Object? object) {
981981

982982
String instanceTypeName(Object? object) {
983983
Rti rti = instanceType(object);
984-
return _rtiToString(rti, null);
984+
return rtiToString(rti);
985985
}
986986

987987
Rti _instanceTypeFromConstructor(Object? instance) {
@@ -1169,7 +1169,7 @@ class _Type implements Type {
11691169
}
11701170

11711171
@override
1172-
String toString() => _rtiToString(_rti, null);
1172+
String toString() => rtiToString(_rti);
11731173
}
11741174

11751175
Rti _getTypeRti(Type type) => _Utils.as_Type(type)._rti;
@@ -1467,7 +1467,7 @@ Object? _generalNullableAsCheckImplementation(Object? object) {
14671467
}
14681468

14691469
_TypeError _errorForAsCheck(Object? object, Rti testRti) {
1470-
String message = _Error.compose(object, _rtiToString(testRti, null));
1470+
String message = _Error.compose(object, rtiToString(testRti));
14711471
return _TypeError.fromMessage(message);
14721472
}
14731473

@@ -1477,7 +1477,7 @@ Rti checkTypeBound(Rti type, Rti bound, String variable, String methodName) {
14771477
if (isSubtype(_theUniverse(), type, bound)) return type;
14781478
String message =
14791479
"The type argument '${_rtiToString(type, null)}' is not"
1480-
" a subtype of the type variable bound '${_rtiToString(bound, null)}'"
1480+
" a subtype of the type variable bound '${rtiToString(bound)}'"
14811481
" of type variable '$variable' in '$methodName'.";
14821482
throw _TypeError.fromMessage(message);
14831483
}
@@ -1496,7 +1496,7 @@ class _Error extends Error {
14961496
static String compose(Object? object, String checkedTypeDescription) {
14971497
String objectDescription = Error.safeToString(object);
14981498
Rti objectRti = _structuralTypeOf(object);
1499-
String objectTypeDescription = _rtiToString(objectRti, null);
1499+
String objectTypeDescription = rtiToString(objectRti);
15001500
return "${objectDescription}:"
15011501
" type '${objectTypeDescription}'"
15021502
" is not a subtype of type '${checkedTypeDescription}'";
@@ -1829,10 +1829,6 @@ String _functionRtiToString(
18291829
}
18301830

18311831
/// Returns a human readable version of [rti].
1832-
///
1833-
/// The result is equivalent to `createRuntimeType(rti).toString()`.
1834-
///
1835-
/// Called by the DDC runtime library for type error messages.
18361832
String rtiToString(Object rti) => _rtiToString(_Utils.asRti(rti), null);
18371833

18381834
String _rtiToString(Rti rti, List<String>? genericContext) {

0 commit comments

Comments
 (0)