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
We recently eliminated calls to join from semantic analysis and postponed them to callbacks before type checking. However, third pass still calls is_subtype and is_same_type. I think this can cause problems, and it is better to refactor these calls to a later stage (probably also to the callbacks).
We are seeing a crash due to this issue, when (accidentally) using a module in a Union inside a container type. Repro code is:
import datetime
from typing import List, Union
x: List[Union[int, datetime]] = []
x.append(1)
Obviously the code intends to use datetime.datetime instead of datetime, but it should not cause a crash. Remove either the Union or the List and we instead see the expected "invalid type" error.
We recently eliminated calls to
join
from semantic analysis and postponed them to callbacks before type checking. However, third pass still callsis_subtype
andis_same_type
. I think this can cause problems, and it is better to refactor these calls to a later stage (probably also to the callbacks).This was discovered while working on #3952
The text was updated successfully, but these errors were encountered: