From f8fbd2976ddcd736ab0c0177f8b70a32e9a4fc98 Mon Sep 17 00:00:00 2001 From: crimaniak Date: Thu, 15 Mar 2018 23:48:34 +0300 Subject: [PATCH] Add error message for static assert in bitmanip.d Static assert, checking the number of bits for a field with the type bool, did not have an error message. --- std/bitmanip.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/std/bitmanip.d b/std/bitmanip.d index f6ce8602d..f8b2e7bd4 100644 --- a/std/bitmanip.d +++ b/std/bitmanip.d @@ -107,7 +107,8 @@ private template createAccessors( static if (is(T == bool)) { - static assert(len == 1); + static assert(len == 1, "`" ~ name ~ + "` definition problem: type `bool` is only allowed for single-bit fields"); enum result = // getter "@property bool " ~ name ~ "() @safe pure nothrow @nogc const { return "