Avoid runtimeType.toString in describeIdentity (#49087)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
dc94e479d1
commit
1a061dd8e5
@@ -9,6 +9,7 @@ import 'package:meta/meta.dart';
|
||||
import 'assertions.dart';
|
||||
import 'constants.dart';
|
||||
import 'debug.dart';
|
||||
import 'object.dart';
|
||||
|
||||
// Examples can assume:
|
||||
// int rows, columns;
|
||||
@@ -2962,7 +2963,7 @@ String shortHash(Object object) {
|
||||
/// distinguish instances of the same class (hash collisions are
|
||||
/// possible, but rare enough that its use in debug output is useful).
|
||||
/// * [Object.runtimeType], the [Type] of an object.
|
||||
String describeIdentity(Object object) => '${object.runtimeType}#${shortHash(object)}';
|
||||
String describeIdentity(Object object) => '${objectRuntimeType(object, '<optimized out>')}#${shortHash(object)}';
|
||||
|
||||
// This method exists as a workaround for https://github.com/dart-lang/sdk/issues/30021
|
||||
/// Returns a short description of an enum value.
|
||||
|
||||
Reference in New Issue
Block a user