Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 12902 - [ICE] Assertion failure '!ae->lengthVar' in 'expres…
…sion.c' when using `opDollar`
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ice12902.d(20): Error: variable ice12902.main.__dollar type void is inferred from initializer s.opDollar(), and variables cannot be of type void | ||
fail_compilation/ice12902.d(20): Error: expression s.opDollar() is void and has no value | ||
--- | ||
*/ | ||
|
||
struct S | ||
{ | ||
void opDollar() { } | ||
void opIndex() { } | ||
void opIndexAssign() { } | ||
void opSliceAssign() { } | ||
} | ||
|
||
void main() | ||
{ | ||
S s; | ||
s[] = s[$]; | ||
} |