On Friday, 9 September 2022 at 17:35:44 UTC, Dennis wrote:
On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov
wrote:
What's about new `compileOutput` trait that returns compiler
output?
```d
static assert(__traits(compileOutput, { }) ==
"message");
```
As a compiler dev, that sou
On 9/9/22 10:35, Dennis wrote:
> On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov wrote:
>> What's about new `compileOutput` trait that returns compiler output?
>> ```d
>> static assert(__traits(compileOutput, { }) == "message");
>> ```
>
> As a compiler dev, that sounds terrifying. I
On Friday, 9 September 2022 at 16:41:54 UTC, Andrey Zherikov
wrote:
What's about new `compileOutput` trait that returns compiler
output?
```d
static assert(__traits(compileOutput, { }) ==
"message");
```
As a compiler dev, that sounds terrifying. It would make
basically every change to dmd
On Friday, 9 September 2022 at 15:22:30 UTC, Ali Çehreli wrote:
I added and removed '&& false' to every 'static assert'
condition manually one by one. :/
It's not CI-friendly :(
Perhaps a new compiler switch can compile every 'static assert'
with an automatic 'false' and dump all their text t
; case.
The following program compiles! :)
void main() {
static assert (true, "hello" / WAT);
}
> Is there a way to validate static asserts in unit tests?
I added and removed '&& false' to every 'static assert' condition
manually one by one. :/
On Friday, 9 September 2022 at 14:35:33 UTC, Andrey Zherikov
wrote:
I have bunch of `static assert(, )` in my
code and would like to validate that specific code triggers
specific assert by checking what `` is thrown.
It sounds like maybe your goal here is to test that attempting to
compile a
n't like this approach because unit test doesn't really test
`f()` (it tests duplicated code) so it can't guarantee that `f()` works
as expected.
Is there a way to validate static asserts in unit tests?
Even this doesn't validate that you get the right message for the
oesn't really
test `f()` (it tests duplicated code) so it can't guarantee that
`f()` works as expected.
Is there a way to validate static asserts in unit tests?