Assigning cls()
does not narrow optional type
#2813
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Using pyright 1.1.203.
The problem is a regression, wasn't there in 1.1.202.
The following code will not typecheck:
Changing the assignment to
cls.instance = A()
makes the error go away.In pyright .202, the revealed type of
cls.instance
isSelf@A | A
.The text was updated successfully, but these errors were encountered: