You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x1: int|"str"# E: Union syntax cannot be used with string operand; use quotes around entire expression x2: int|str|"bytes"# Runtime error, no pyright errorU: TypeAlias=int|strx3: U|"bytes"# Runtime error, no pyright errorx4: "bytes"|U# Runtime error, no pyright error
Command-line
$ pyright example.py
example.py
example.py:1:11 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues)
1 error, 0 warnings, 0 informations
$ pyright --version
pyright 1.1.389
The text was updated successfully, but these errors were encountered:
Describe the bug
Pyright does not reject quoted types in union syntax when combined with a
UnionType
operand.Code or Screenshots
[pyright playground]
Command-line
$ pyright example.py example.py example.py:1:11 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) 1 error, 0 warnings, 0 informations $ pyright --version pyright 1.1.389
The text was updated successfully, but these errors were encountered: