From 537f17f71a72dfae4a6c1799a7e12dc8d918108d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Mon, 21 Nov 2016 20:20:14 +0100 Subject: [PATCH] Add assertion error message. --- source/taggedalgebraic.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/taggedalgebraic.d b/source/taggedalgebraic.d index 18a12d7..40e0ad9 100644 --- a/source/taggedalgebraic.d +++ b/source/taggedalgebraic.d @@ -603,7 +603,8 @@ unittest { // issue #1 */ ref inout(T) get(T, U)(ref inout(TaggedAlgebraic!U) ta) { - assert(hasType!(T, U)(ta)); + import std.format : format; + assert(hasType!(T, U)(ta), () { scope (failure) assert(false); return format("Trying to get %s but have %s.", T.stringof, ta.kind); } ()); return ta.trustedGet!T; }