TP0219
Error: generic instantiation too deep (polymorphic recursion)
Messages
Section titled “Messages”instantiating '<f>' needs '<f>[<T>]', which is too deep, at the call that starts the chain
Example
Section titled “Example”From the golden case tests/cases/m8/tp0219_polymorphic.tpn:
def grow[T](x: T, n: int) -> int: if n == 0: return 0 return grow([x], n - 1)
print(grow(1, 3))The compiler reports:
tp0219_polymorphic.tpn:6:1: error TP0219: instantiating 'grow' needs 'grow[list[list[list[...]]]]', which is too deepThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.