Closed
Description
from typing import TypeVar
T = TypeVar('T')
class C(object): # forgot to add type params here
def __init__(self, t : T) -> None:
self.t = t
c = C(t = 3) # type: C[int] # this will crash
causes:
Traceback (most recent call last):
...
cb = infer_constraints(mapped.args[i], instance.args[i],
IndexError: list index out of range
I guess this generalizes #981 and provides an additional example, here with an (accidentally) non-generic type (though the same happens if too few type arguments are supplied). I'm not sure if it overlaps with #300.