Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8144 from WalterBright/fix18737
fix Issue 18737 - An assert(0) should be a leaf in constructor flow a… merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
33 additions
and
44 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 was deleted.
Oops, something went wrong.
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,32 @@ | ||
/* REQUIRED_ARGS: | ||
* PERMUTE_ARGS: | ||
*/ | ||
|
||
// https://issues.dlang.org/show_bug.cgi?id=18737 | ||
|
||
struct S | ||
{ | ||
this(char); | ||
|
||
this(int j) | ||
{ | ||
this('a'); | ||
assert(0); | ||
this('b'); | ||
} | ||
|
||
this(long j) | ||
{ | ||
if (j) | ||
{ | ||
this('c'); | ||
assert(0); | ||
} | ||
else if (j + 1) | ||
{ | ||
this('d'); | ||
return; | ||
} | ||
this('e'); | ||
} | ||
} |