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

Templated TypeInfo #3174

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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
More tests
andralex committed Jul 28, 2020
commit 34ad3682e1264e732042b98e045d42952a2a5254
3 changes: 3 additions & 0 deletions src/object.d
Original file line number Diff line number Diff line change
@@ -540,7 +540,10 @@ unittest
alias id = __typeid!int;
immutable TypeInfo id2 = id; // Implicitly convert to base, losing static type information
static assert(id == id && id <= id && id >= id);
static assert(id2 == id && id2 <= id && id2 >= id);
static assert(id == id2 && id <= id2 && id >= id2);
static assert(id.toString == "int");
static assert(id2.toString == "int");
int a = 42, b = 42, c = 43;
assert(id.getHash(&a) == 42);
assert(id2.getHash(&a) == 42);