You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
might be how users write custom is-checks to see if a given type is some templated type, however for isSomething!noreturn this returns true, which might be unexpected for the user. (see forum discussion)
My check idea to add would be warning if noreturn isn't explicitly handled for global templates or maybe even everywhere. (could be configurable)
so for the code above it would give a warning and the user would have a few choices to fix it:
// noreturn is not SomethingenumisSomething(T) = is(T : Something!Types, Types...)
&&!is(immutable T ==immutable noreturn);
// noreturn is SomethingenumisSomething(T) = is(T : Something!Types, Types...)
||is(immutable T ==immutable noreturn);
// only match exact Something (no alias this support anymore though)enumisSomething(T) = is(T == Something!Types, Types...);
to keep the check simple it would just check for any is(T : ...) expression and see if in the same expression or template T is compared with noreturn.
The text was updated successfully, but these errors were encountered:
See https://forum.dlang.org/thread/xmjabqpofltdwxfqlwhi@forum.dlang.org
code like
might be how users write custom is-checks to see if a given type is some templated type, however for
isSomething!noreturn
this returnstrue
, which might be unexpected for the user. (see forum discussion)My check idea to add would be warning if noreturn isn't explicitly handled for global templates or maybe even everywhere. (could be configurable)
so for the code above it would give a warning and the user would have a few choices to fix it:
to keep the check simple it would just check for any
is(T : ...)
expression and see if in the same expression or template T is compared withnoreturn
.The text was updated successfully, but these errors were encountered: