Add assertion error message.
This commit is contained in:
parent
58a1cc274f
commit
537f17f71a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue