Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e5e562e

Browse files
committed
Fix name of string
1 parent 3f2a646 commit e5e562e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rt/util/typeinfo.d

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,11 @@ class TypeInfo_Ag : TypeInfoArrayGeneric!byte {}
515515
class TypeInfo_Ah : TypeInfoArrayGeneric!ubyte {}
516516
class TypeInfo_Aa : TypeInfoArrayGeneric!char {}
517517
class TypeInfo_Axa : TypeInfoArrayGeneric!(const char) {}
518-
class TypeInfo_Aya : TypeInfoArrayGeneric!(immutable char) {}
518+
class TypeInfo_Aya : TypeInfoArrayGeneric!(immutable char)
519+
{
520+
// Must override this, otherwise "string" is returned.
521+
override string toString() const { return "immutable(char)[]"; }
522+
}
519523
class TypeInfo_As : TypeInfoArrayGeneric!short {}
520524
class TypeInfo_At : TypeInfoArrayGeneric!ushort {}
521525
class TypeInfo_Au : TypeInfoArrayGeneric!wchar {}
@@ -529,6 +533,7 @@ extern (C) void[] _adSort(void[] a, TypeInfo ti);
529533

530534
unittest
531535
{
536+
assert(typeid(string).toString() == "immutable(char)[]");
532537
int[][] a = [[5,3,8,7], [2,5,3,8,7]];
533538
_adSort(*cast(void[]*)&a, typeid(a[0]));
534539
assert(a == [[2,5,3,8,7], [5,3,8,7]]);

0 commit comments

Comments
 (0)