Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Issue 18620 - error cannot be interpreted at compile time is miss…
…ing context where error ocurrs
- Loading branch information
Showing
6 changed files
with
77 additions
and
11 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
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/fail18620.d(14): Error: `strlen` cannot be interpreted at compile time, because it has no available source code | ||
fail_compilation/fail18620.d(19): compile time context created here: `static A a = new A("a");` | ||
fail_compilation/fail18620.d(14): Error: `strlen` cannot be interpreted at compile time, because it has no available source code | ||
fail_compilation/fail18620.d(20): compile time context created here: `__gshared A b = new A("b");` | ||
--- | ||
*/ | ||
class A{ | ||
this(const(char)* s) | ||
{ | ||
import core.stdc.string; | ||
auto a=strlen(s); | ||
} | ||
} | ||
|
||
void main(){ | ||
static a = new A("a"); | ||
__gshared b = new A("b"); | ||
} |