-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Labels
scoping-control-flowissues related to scoping and control flowissues related to scoping and control flow
Description
Describe the Bug
def mySplit(s: str) -> None:
inQuote: bool | str = False
res: list[str] = []
for c in s:
if c == inQuote:
...
elif inQuote:
inQuote = c
res[-1] += cERROR 10:13-25: `+=` is not supported between `str` and `bool` [[unsupported-operation](https://pyrefly.org/en/docs/error-kinds/#unsupported-operation)]
Although c is pretty clearly a "str", and never modified except in the for c in s, the type of inQuote is copied into the type of c (bool | str).
I have reported similiar bugs, but they came with another exception, had a slightly different reason and this one is hopefully easier to debug, so I reported this, too.
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
scoping-control-flowissues related to scoping and control flowissues related to scoping and control flow