-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[red-knot] Do not panic when encountering string annotations (#14091)
## Summary Encountered this while running red-knot benchmarks on the `black` codebase. Fixes two of the issues in #13478. ## Test Plan Added a regression test.
- Loading branch information
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
crates/red_knot_python_semantic/resources/mdtest/annotations/string_annotations.md
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,9 @@ | ||
# String annotations | ||
|
||
```py | ||
def f() -> "int": | ||
return 1 | ||
|
||
# TODO: We do not support string annotations, but we should not panic if we encounter them | ||
reveal_type(f()) # revealed: @Todo | ||
``` |
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