-
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.
feat: Update CFG checker to use new diagnostics (#589)
- Loading branch information
Showing
27 changed files
with
383 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Guppy compilation failed. Error in file $FILE:9 | ||
Error: Variable not defined (at $FILE:9:15) | ||
| | ||
7 | return z | ||
8 | else: | ||
9 | return z | ||
| ^ `z` might be undefined ... | ||
| | ||
6 | if x and (z := y + 1): | ||
| - ... if this expression is `False` | ||
|
||
7: return z | ||
8: else: | ||
9: return z | ||
^ | ||
GuppyError: Variable `z` is not defined on all control-flow paths. | ||
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Guppy compilation failed. Error in file $FILE:7 | ||
Error: Variable not defined (at $FILE:7:11) | ||
| | ||
5 | def foo(x: bool) -> int: | ||
6 | (y := 1) if x else (z := 2) | ||
7 | return z | ||
| ^ `z` might be undefined ... | ||
| | ||
6 | (y := 1) if x else (z := 2) | ||
| - ... if this expression is `True` | ||
|
||
5: def foo(x: bool) -> int: | ||
6: (y := 1) if x else (z := 2) | ||
7: return z | ||
^ | ||
GuppyError: Variable `z` is not defined on all control-flow paths. | ||
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
Guppy compilation failed. Error in file $FILE:8 | ||
Error: Different types (at $FILE:8:11) | ||
| | ||
6 | y = 3 | ||
7 | (y := y + 1) if x else (y := True) | ||
8 | return y | ||
| ^ Variable `y` may refer to different types | ||
| | ||
7 | (y := y + 1) if x else (y := True) | ||
| - This is of type `int` | ||
| | ||
7 | (y := y + 1) if x else (y := True) | ||
| - This is of type `bool` | ||
|
||
6: y = 3 | ||
7: (y := y + 1) if x else (y := True) | ||
8: return y | ||
^ | ||
GuppyError: Variable `y` can refer to different types: `int` (at 7:5) vs `bool` (at 7:28) | ||
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Guppy compilation failed. Error in file $FILE:10 | ||
Error: Variable not defined (at $FILE:10:11) | ||
| | ||
8 | else: | ||
9 | z = 2 | ||
10 | return z | ||
| ^ `z` might be undefined ... | ||
| | ||
6 | if x: | ||
| - ... if this expression is `True` | ||
|
||
8: else: | ||
9: z = 2 | ||
10: return z | ||
^ | ||
GuppyError: Variable `z` is not defined on all control-flow paths. | ||
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
Guppy compilation failed. Error in file $FILE:11 | ||
Error: Different types (at $FILE:11:11) | ||
| | ||
9 | else: | ||
10 | y = True | ||
11 | return y | ||
| ^ Variable `y` may refer to different types | ||
| | ||
8 | y += 1 | ||
| - This is of type `int` | ||
| | ||
10 | y = True | ||
| - This is of type `bool` | ||
|
||
9: else: | ||
10: y = True | ||
11: return y | ||
^ | ||
GuppyError: Variable `y` can refer to different types: `int` (at 8:8) vs `bool` (at 10:8) | ||
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Guppy compilation failed. Error in file $FILE:8 | ||
Error: Variable not defined (at $FILE:8:11) | ||
| | ||
6 | for _ in xs: | ||
7 | y = 5 | ||
8 | return y | ||
| ^ `y` might be undefined ... | ||
| | ||
6 | for _ in xs: | ||
| -- ... if this expression is `False` | ||
|
||
6: for _ in xs: | ||
7: y = 5 | ||
8: return y | ||
^ | ||
GuppyError: Variable `y` is not defined on all control-flow paths. | ||
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
Guppy compilation failed. Error in file $FILE:8 | ||
Error: Variable not defined (at $FILE:8:11) | ||
| | ||
6 | for x in xs: | ||
7 | pass | ||
8 | return x | ||
| ^ `x` might be undefined ... | ||
| | ||
6 | for x in xs: | ||
| -- ... if this expression is `False` | ||
|
||
6: for x in xs: | ||
7: pass | ||
8: return x | ||
^ | ||
GuppyError: Variable `x` is not defined on all control-flow paths. | ||
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
Guppy compilation failed. Error in file $FILE:9 | ||
Error: Different types (at $FILE:9:11) | ||
| | ||
7 | for x in xs: | ||
8 | pass | ||
9 | return x | ||
| ^ Variable `x` may refer to different types | ||
| | ||
6 | x = 5 | ||
| - This is of type `int` | ||
| | ||
7 | for x in xs: | ||
| - This is of type `bool` | ||
|
||
7: for x in xs: | ||
8: pass | ||
9: return x | ||
^ | ||
GuppyError: Variable `x` can refer to different types: `int` (at 6:4) vs `bool` (at 7:8) | ||
Guppy compilation failed due to 1 previous error |
Oops, something went wrong.