This nonsense is compilable.
---
noreturn square(int x);
int example(int i)
{
int x = cast(string)square(i);
int y = cast(real function(char))assert(0);
return x + y;
}
---
Introduced by https://github.com/dlang/dmd/pull/14494
Comment #1 by dlang-bot — 2022-12-30T12:50:38Z
@ibuclaw updated dlang/dmd pull request #14758 "Revert "Fix Issues 23331, 23379 - fix casts involving noreturn"" fixing this issue:
- fix Issue 23591 - [REG 2.101] Invalid casts accepted by the compiler if from type is noreturn
https://github.com/dlang/dmd/pull/14758
Comment #2 by dlang-bot — 2022-12-31T14:27:44Z
dlang/dmd pull request #14758 "Revert "Fix Issues 23331, 23379 - fix casts involving noreturn"" was merged into master:
- 227b3edae230a4084eacc994cf940ec4e612232b by Iain Buclaw:
fix Issue 23591 - [REG 2.101] Invalid casts accepted by the compiler if from type is noreturn
https://github.com/dlang/dmd/pull/14758