Bug 20432 – assert() and in() don't support tuple expressions

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-12-05T14:53:51Z
Last change time
2024-12-13T19:06:22Z
Assigned to
No Owner
Creator
FeepingCreature
Moved to GitHub: dmd#19646 →

Comments

Comment #0 by default_357-line — 2019-12-05T14:53:51Z
Consider the following code: // this works assertThrown!AssertError({ assert(false, "hello world"); }(), "hello world"); // this doesn't work struct S { bool b; string s; } assertThrown!AssertError({ assert(S(false, "hello world").tupleof); }(), "hello world"); Likewise for in(). This is annoying, because it prevents writing functions that either return success or an error value, or rather forces to call them twice.
Comment #1 by robert.schadek — 2024-12-13T19:06:22Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19646 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB