diff --git a/source/tanya/format.d b/source/tanya/format.d index 46e0add..a42719f 100644 --- a/source/tanya/format.d +++ b/source/tanya/format.d @@ -935,7 +935,7 @@ package(tanya) String format(string fmt, Args...)(auto ref Args args) { } auto instance = defaultAllocator.unique!A(); - assert(format!"{}"(instance.get()) == instance.get.toString()); + assert(format!"{}"(instance.get()) == instance.get().toString()); assert(format!"{}"(cast(I) instance.get()) == I.classinfo.name); assert(format!"{}"(cast(A) null) == "null"); } @@ -965,6 +965,17 @@ package(tanya) String format(string fmt, Args...)(auto ref Args args) assert(format!"{}"(Stringish()) == "Some content"); } +// Typeid. +nothrow pure @safe unittest +{ + assert(format!"{}"(typeid(int[])) == "int[]"); + + class C + { + } + assert(format!"{}"(typeid(C)) == typeid(C).toString()); +} + private struct FormatSpec { }