On Wednesday, 14 July 2021 at 02:42:21 UTC, Paul Backus wrote:
Weirdly, adding a dummy `ResultType` declaration to the `else`
branch makes the assert message show up:
My code is like following:
```d
public struct gudtUGC(typeStringUTF) {
static if (! (is (typeStringUTF == string) || is
(typeStringUTF == wstring) || is (typeStringUTF == dstring))) {
static assert(false, r"ooops … gudtUGC structure requires
[string|wstring|dstring] ≠ ["d ~ typeStringUTF.stringof ~ r"]"d);
/// meaning: this will halt compilation if this UDT was
instantiated with a type other than the ones intended
} else {
... actual structure code
}
}
```
... and it never fired the assert when I added something like:
```d
gudtUGC(int) something = gudtUGC(1); /// invalid of course
```
in main() ... so then I went to the D docs and to Ali's book
afterward and there I tested his example to same results.