Skip to content

TP0223

Error: nested function with type parameters

  • nested functions cannot have type parameters

From the golden case tests/cases/m11/tp0223_nested.tpn:

tp0223_nested.tpn
def outer() -> int:
def inner[T](x: T) -> T:
return x
return 1

The compiler reports:

tp0223_nested.tpn:2:15: error TP0223: nested functions cannot have type parameters

The specification lists every code.