-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Foreach over distinct pointer failed to be caught as error #1506.
- Loading branch information
Showing
3 changed files
with
28 additions
and
4 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
14 changes: 14 additions & 0 deletions
14
test/test_suite/statements/foreach_distinct_pointer_1506.c3
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,14 @@ | ||
distinct Type = char*; | ||
fn usz Type.len(str) | ||
{ | ||
return 0; | ||
} | ||
fn int main(String[] args) | ||
{ | ||
Type x = "AAAAA"; // Or ZString | ||
foreach(y : x) // #error: It's not possible to enumerate an expression | ||
{ | ||
|
||
} | ||
return 0; | ||
} |