-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 22133 - [REG2.097] Breaking change in DotTemplateExp type s…
…emantics leading to e.g. isInputRange regression
- Loading branch information
Showing
13 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// https://issues.dlang.org/show_bug.cgi?id=22133 | ||
|
||
struct Slice | ||
{ | ||
bool empty() const; | ||
int front() const; | ||
void popFront()() // note: requires a mutable Slice | ||
{} | ||
} | ||
|
||
enum isInputRange1(R) = is(typeof((R r) => r.popFront)); | ||
enum isInputRange2(R) = __traits(compiles, (R r) => r.popFront); | ||
static assert(isInputRange1!( Slice) == true); | ||
static assert(isInputRange1!(const Slice) == false); | ||
static assert(isInputRange2!( Slice) == true); | ||
static assert(isInputRange2!(const Slice) == false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// https://issues.dlang.org/show_bug.cgi?id=22133 | ||
/* | ||
TEST_OUTPUT | ||
--- | ||
fail_compilation/fail22133.d(16): Error: `s.popFront()()` has no effect | ||
fail_compilation/fail22133.d(17): Error: template `s.popFront()()` has no type | ||
--- | ||
*/ | ||
struct Slice | ||
{ | ||
void popFront()() {} | ||
} | ||
|
||
auto fail22133(const Slice s) | ||
{ | ||
s.popFront; | ||
return s.popFront; | ||
} | ||
|
||
auto ok22133(Slice s) | ||
{ | ||
s.popFront; | ||
return s.popFront; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters