Add static assertion error message.

This commit is contained in:
Sönke Ludwig 2021-01-14 10:39:08 +01:00
parent 7bc5606ac7
commit 2be696fe01

View file

@ -343,7 +343,8 @@ unittest { // tuple fields
bool areConvertibleTo(alias TYPES, alias TARGET_TYPES)() bool areConvertibleTo(alias TYPES, alias TARGET_TYPES)()
if (isGroup!TYPES && isGroup!TARGET_TYPES) if (isGroup!TYPES && isGroup!TARGET_TYPES)
{ {
static assert(TYPES.expand.length == TARGET_TYPES.expand.length); static assert(TYPES.expand.length == TARGET_TYPES.expand.length,
"Argument count does not match.");
foreach (i, V; TYPES.expand) foreach (i, V; TYPES.expand)
if (!is(V : TARGET_TYPES.expand[i])) if (!is(V : TARGET_TYPES.expand[i]))
return false; return false;