-
-
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.
Merge pull request #1506 from 9rnsr/fix9338
Issue 9338 - Compiler segfaults if try to CTFE member function without valid 'this'
- Loading branch information
Showing
2 changed files
with
31 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ice9338.d(13): Error: value of 'this' is not known at compile time | ||
fail_compilation/ice9338.d(14): Error: value of 'this' is not known at compile time | ||
--- | ||
*/ | ||
|
||
class Foo | ||
{ | ||
void test() | ||
{ | ||
enum members1 = makeArray(); | ||
enum members2 = this.makeArray(); | ||
} | ||
|
||
string[] makeArray() | ||
{ | ||
return ["a"]; | ||
} | ||
} |