Issue 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument
Summary: [REG2.108] No short-circuit evaluation of mixing template bool argument
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: industry, pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2024-08-12 13:03 UTC by johanengelen
Modified: 2024-11-16 23:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description johanengelen 2024-08-12 13:03:42 UTC
Testcase:
```
mixin template StaticAssertAt(bool cond) {
    static if (!cond) {
        pragma(msg, "asd");
    }
}

template foo(T) {
    enum foo = false;
    mixin StaticAssertAt!(true || T.tupleof.length == 1);
}

enum a = foo!ubyte;
```

The test case compiles with 2.107 but not with 2.108. The short-circuit evaluation of || is not happening, thus 2.108 errors with:
Error: no property `tupleof` for type `ubyte`

https://d.godbolt.org/z/fYYYfhq95
Comment 1 Dennis 2024-08-13 20:01:38 UTC
Introduced by https://github.com/dlang/dmd/pull/15968
Comment 2 Dlang Bot 2024-08-13 20:30:22 UTC
@dkorpel created dlang/dmd pull request #16781 "Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing…" fixing this issue:

- Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument

https://github.com/dlang/dmd/pull/16781
Comment 3 Dlang Bot 2024-08-14 22:47:53 UTC
dlang/dmd pull request #16781 "Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing…" was merged into stable:

- dd409f40f3b280a67b65330c173d3f46d316da7d by Dennis Korpel:
  Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument

https://github.com/dlang/dmd/pull/16781
Comment 4 Dlang Bot 2024-10-07 09:00:26 UTC
dlang/dmd pull request #16967 "Rebase stable6" was merged into master:

- 4b3ce3c145a89ea0611637e59b2b4ec4e6b9822c by Dennis Korpel:
  Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument

https://github.com/dlang/dmd/pull/16967
Comment 5 Dlang Bot 2024-11-16 23:27:11 UTC
dlang/dmd pull request #17069 "Merge stable" was merged into master:

- 636f4d3ba280cff50ced4d553cd34869fd69ba16 by Dennis Korpel:
  Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument

https://github.com/dlang/dmd/pull/17069