Bug 22133 – [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-07-20T11:03:05Z
Last change time
2021-08-03T02:32:13Z
Keywords
pull
Assigned to
No Owner
Creator
kinke

Comments

Comment #0 by kinke — 2021-07-20T11:03:05Z
``` import std.range.primitives : isInputRange; struct Slice { bool empty() const; int front() const; void popFront()() // note: requires a mutable Slice {} } static assert(isInputRange!( Slice) == true); static assert(isInputRange!(const Slice) == false); // fails since v2.097 ``` It boils down to both of the following assertions failing since v2.097: ``` enum isInputRange1(R) = is(typeof((R r) => r.popFront)); enum isInputRange2(R) = __traits(compiles, (R r) => r.popFront); static assert(isInputRange1!(const Slice) == false); static assert(isInputRange2!(const Slice) == false); ``` Regression introduced by https://github.com/dlang/dmd/pull/12294.
Comment #1 by dlang-bot — 2021-07-20T11:06:13Z
@ibuclaw updated dlang/dmd pull request #12897 "Revert "Fix Issue 21742 - dot template expressions don't have the void type like any template" fixing this issue: - fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression https://github.com/dlang/dmd/pull/12897
Comment #2 by dlang-bot — 2021-07-21T16:55:00Z
dlang/dmd pull request #12897 "fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression" was merged into stable: - 930e6139ff181de42a889d3008408684bb3c31cf by Iain Buclaw: fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression https://github.com/dlang/dmd/pull/12897
Comment #3 by dlang-bot — 2021-07-25T15:27:31Z
dlang/dmd pull request #12920 "[dmd-cxx] fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression" was merged into dmd-cxx: - 0b0591a50c0f6db6b6539cb3dba95edd291592d5 by Iain Buclaw: [dmd-cxx] fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression https://github.com/dlang/dmd/pull/12920
Comment #4 by dlang-bot — 2021-08-03T02:32:13Z
dlang/dmd pull request #12944 "Merge branch 'stable' into merge_master" was merged into master: - f9e8117fd740638258dcad3997d6eaff5589f2e5 by Iain Buclaw: fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type semantics leading to e.g. isInputRange regression https://github.com/dlang/dmd/pull/12944