unexpected noreturn behavior

WebFreak001 d.forum at webfreak.org
Thu Apr 21 12:15:31 UTC 2022


What would you expect for this code?

```d
struct Something(Types...) {}

enum isSomethingExact(T) = is(T == Something!Types, Types...);
enum isSomething(T) = is(T : Something!Types, Types...);

pragma(msg, isSomethingExact!noreturn);
pragma(msg, isSomething!noreturn);
```

This currently outputs `false`, `true` which breaks my code 
because more concretely `isSumType!(typeof(someMethod()))` 
returns true. I can add a check for noreturn before that, but it 
seems a little weird that noreturn returns true for isSomething!T 
and functions like that in phobos.


More information about the Digitalmars-d-learn mailing list