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

Simplified TypeInfo, take 2: factor common code in #3206

Merged
merged 18 commits into from
Sep 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix name of string
  • Loading branch information
andralex committed Sep 5, 2020
commit e5e562ea010f42186e3acfc489fa813eb7441607
7 changes: 6 additions & 1 deletion src/rt/util/typeinfo.d
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@ class TypeInfo_Ag : TypeInfoArrayGeneric!byte {}
class TypeInfo_Ah : TypeInfoArrayGeneric!ubyte {}
class TypeInfo_Aa : TypeInfoArrayGeneric!char {}
class TypeInfo_Axa : TypeInfoArrayGeneric!(const char) {}
class TypeInfo_Aya : TypeInfoArrayGeneric!(immutable char) {}
class TypeInfo_Aya : TypeInfoArrayGeneric!(immutable char)
{
// Must override this, otherwise "string" is returned.
override string toString() const { return "immutable(char)[]"; }
}
class TypeInfo_As : TypeInfoArrayGeneric!short {}
class TypeInfo_At : TypeInfoArrayGeneric!ushort {}
class TypeInfo_Au : TypeInfoArrayGeneric!wchar {}
Expand All @@ -529,6 +533,7 @@ extern (C) void[] _adSort(void[] a, TypeInfo ti);

unittest
{
assert(typeid(string).toString() == "immutable(char)[]");
int[][] a = [[5,3,8,7], [2,5,3,8,7]];
_adSort(*cast(void[]*)&a, typeid(a[0]));
assert(a == [[2,5,3,8,7], [5,3,8,7]]);
Expand Down