digitalmars.D.bugs - [Issue 19087] New: `final switch` cannot be used in -betterC
- d-bugmail puremagic.com (33/33) Jul 14 2018 https://issues.dlang.org/show_bug.cgi?id=19087
https://issues.dlang.org/show_bug.cgi?id=19087 Issue ID: 19087 Summary: `final switch` cannot be used in -betterC Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: druntime Assignee: nobody puremagic.com Reporter: slavo5150 yahoo.com void test(int p) { final switch (p) { case 42: break; } } void main() { test(0); } dmd -betterC test.d /dlang/dmd/linux/bin64/../../src/druntime/import/core/exception.d(584): Error: Cannot use throw statements with -betterC /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4180): Error: template instance `core.exception.__switch_errorT!()` error instantiating This is caused by a `throw` statement in the implementation of `__switch_errorT` in druntime. It should probably be an `assert`. --
Jul 14 2018