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
In our code we have some use cases, where we use the type to mark, say, where the exception is happening. The code here only knows that the type will be following a specific protocol (Entity), but at call site we only know a union of possible concrete types.
The code specifically that we have can be worked around, but I wondered whether the behavior change is intended or an accidental bug. We've leveraged it and it worked so far up to 0.770. In 0.780 and 0.790 that code snippet will throw an error:
example_test.py:18: error: Argument 1 to "foo" has incompatible type "object"; expected "Type[Entity]"
Found 1 error in 1 file (checked 1 source file)
Which looks like the Union has been normalized to an object which seems incorrect.
The text was updated successfully, but these errors were encountered:
Bug Report
Here's the code snippet:
In our code we have some use cases, where we use the type to mark, say, where the exception is happening. The code here only knows that the type will be following a specific protocol (
Entity
), but at call site we only know a union of possible concrete types.The code specifically that we have can be worked around, but I wondered whether the behavior change is intended or an accidental bug. We've leveraged it and it worked so far up to 0.770. In 0.780 and 0.790 that code snippet will throw an error:
Which looks like the Union has been normalized to an
object
which seems incorrect.The text was updated successfully, but these errors were encountered: