Bug 18304 – std.format functions with compile time format strings should be nothrow

Status
REOPENED
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-01-26T15:49:09Z
Last change time
2024-12-01T16:32:15Z
Assigned to
No Owner
Creator
Jack Stouffer
Moved to GitHub: phobos#9739 →

Comments

Comment #0 by jack — 2018-01-26T15:49:09Z
Comment #1 by b2.temp — 2024-04-23T12:28:46Z
Why the heck would they have to be ? ``` void main() { import std; int i = 0; format!"%s"((){if (!i) throw new Exception("oops"); return "helloho"; }()).writeln; } ``` just let attribute inference do the job.
Comment #2 by jack — 2024-04-23T15:57:01Z
The point is that void main() nothrow { import std; int i = 0; format!"%s"("This is a string"); } doesn't work because exceptions are still thrown for checks that should be happening at compile time. E.g. attribute inference cannot be done.
Comment #3 by robert.schadek — 2024-12-01T16:32:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9739 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB