Bug 14685 – [REG2.067] Silent incorrect behavior with enforce and custom exception
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-11T19:55:00Z
Last change time
2017-07-19T17:43:31Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
dlang-bugzilla
Comments
Comment #0 by dlang-bugzilla — 2015-06-11T19:55:31Z
Today, I wrote the following code:
/////////////// test.d //////////////
import std.exception;
class NotFoundException : Exception
{
this() { super("Not found"); }
}
void main()
{
enforce!NotFoundException(false);
}
/////////////////////////////////////
It compiles fine, but does not actually throw anything.
This seems to be a regression, as previously it did not compile.
Introduced in https://github.com/D-Programming-Language/phobos/pull/2288