-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Properly report errors for unsupported subscript assignments
- Loading branch information
Showing
3 changed files
with
28 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,8 @@ | ||
Error: Unsupported (at $FILE:11:4) | ||
| | ||
9 | @guppy(module) | ||
10 | def main(xs: array[int, 10]) -> None: | ||
11 | xs[0] = 1 | ||
| ^^^^^ Subscript assignments are not supported | ||
|
||
Guppy compilation failed due to 1 previous error |
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 @@ | ||
from guppylang.decorator import guppy | ||
from guppylang.module import GuppyModule | ||
from guppylang.std.builtins import array, owned | ||
|
||
|
||
module = GuppyModule("test") | ||
|
||
|
||
@guppy(module) | ||
def main(xs: array[int, 10]) -> None: | ||
xs[0] = 1 | ||
|
||
|
||
module.compile() |