Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #1818 from 9rnsr/fix9759
[REG2.063a] Issue 9759 - compiler segfault in StructLiteral::implicitConvTo(Type*) on invalid code
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ice9759.d(24): Error: mutable method ice9759.Json.opAssign is not callable using a const object | ||
--- | ||
*/ | ||
|
||
struct Json | ||
{ | ||
union | ||
{ | ||
Json[] m_array; | ||
Json[string] m_object; | ||
} | ||
|
||
void opAssign(Json v) | ||
{ | ||
} | ||
} | ||
|
||
void bug() | ||
{ | ||
const(Json) r; | ||
r = r.init; | ||
} |