Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Issue 7420 - Return ErrorExp on error to avoid duplicate errors.
Force 32bit diagnostics for test-case.
- Loading branch information
1 parent
81860f8
commit 550c25d
Showing
2 changed files
with
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// REQUIRED_ARGS: -m32 | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag7420.d(3): Error: variable x cannot be read at compile time | ||
fail_compilation/diag7420.d(3): while evaluating: static assert(x < 4) | ||
fail_compilation/diag7420.d(4): Error: variable y cannot be read at compile time | ||
fail_compilation/diag7420.d(4): while evaluating: static assert(y == "abc") | ||
fail_compilation/diag7420.d(5): Error: variable y cannot be read at compile time | ||
fail_compilation/diag7420.d(5): while evaluating: static assert(cast(ubyte[])y != null) | ||
fail_compilation/diag7420.d(6): Error: variable y cannot be read at compile time | ||
fail_compilation/diag7420.d(6): while evaluating: static assert(cast(int)y[0u] == 1) | ||
fail_compilation/diag7420.d(7): Error: variable y cannot be read at compile time | ||
fail_compilation/diag7420.d(7): while evaluating: static assert(y[0u..1u].length == 1u) | ||
--- | ||
*/ | ||
|
||
#line 1 | ||
int x = 2; | ||
char[] y = "abc".dup; | ||
static assert(x < 4); | ||
static assert(y == "abc"); | ||
static assert(cast(ubyte[])y != null); | ||
static assert(y[0] == 1); | ||
static assert(y[0..1].length == 1); |