Closed
Description
Making a list of types looks weird, but this was originally used to construct a typing.NamedTuple
.
import typing
from typing import Tuple, Callable, Any, List
from enum import Enum
class MyEnum(Enum):
def __new__(cls): pass
def F(fields: List[Callable[[Any], Any]]): pass
class SomeEnum(MyEnum):
x = 1
F([SomeEnum])
produces:
Traceback (most recent call last):
...
File "/home/bdarwin/.local/lib/python3.5/site-packages/mypy/types.py", line 346, in accept
return visitor.visit_callable_type(self)
File "/home/bdarwin/.local/lib/python3.5/site-packages/mypy/constraints.py", line 231, in visit_callable_type
template.arg_types[i], cactual.arg_types[i],
IndexError: list index out of range
*** INTERNAL ERROR ***
foo.py:13: error: Internal error -- please report a bug at https://github.com/JukkaL/mypy/issues
The program exited via sys.exit(). Exit status: 1