-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
astral-sh/ruff
#18750Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.
Description
Summary
For the following snippet :
def _(flag1: bool, flag2: bool):
if flag1:
x: str
elif flag2:
x: int
else:
x: int
x = 1We will have the following error : error[conflicting-declarations]: Conflicting declared types for `x`: str, int, int. However, the list of conflicting declared types should consist of unique elements.
I think it caused by the implementation logic, more specifically when adding types to the list of conflicting declared types, the code only checks if the new type is different from the first one but it should do it for all elements already in the list.
If it is caused by that, I think I can handle this issue!
Version
ty 0.0.1-alpha.11
Metadata
Metadata
Assignees
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.