Improve handling of Type[...] so distinguish between types and instances properly
DinoV opened this issue · comments
Dino Viehland commented
Currently we don't really fully handle instances of types correctly. One example of this is:
def produce() -> type:
@final
class C:
pass
return C
C = produce()
reveal_type(C)
The inferred type of "C" becomes "Type[type]", when it really should be "Type[object]", "Type[typing.Any]" or "Type[dynamic]".
There's other places that tie into this like can_assign_from might be better taking a Value
vs. a class.