Does not parse type annotations with nested quotes: `x: "list[\"int\"]"`
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 519
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
I'm not sure if there's a standard, but apparently mypy, pyright and pydantic all accept type annotations with nested quotes like `x: "list[\"int\"]"`. Pyrefly raises an "Expected a type form, got instance of `Literal['int']`" error.
- https://pyright-play.net/?strict=true&code=IYLgBANglgzgLgbSgOzgXTAXjAtAoAI3GngQCIU4yNtc8BjY2RAckpZp3wBNwWTEFVNRZYueAKbgyAhAB0hcBWjJi6AM2mzKKtfiA
- https://mypy-play.net/?gist=30975017f4ade21f3750499e6578b486
- pydantic: `TypeAdapter("list[\"int\"]").validate_python([1, 2, 3])`
This occurred in a scenario, where we want to automatically stringify annotations in the source code.
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.