TP0220
Error: invalid type parameter constraint or bound
Messages
Section titled “Messages”a bound can't use type parameters(M40)a constraint needs at least two types'<T>' is listed twice in the constrainta constraint cannot be optional or genericconstraints are only supported on functions'<T>' is not a protocol(with helpclass bounds are not supported, for a class)bounds are only supported on functions(M17)
Example
Section titled “Example”From the golden case tests/cases/m18/tp0220_alias.tpn:
# An alias's type parameters take no constraints or bounds (SPEC §3.12).type Numbers[N: (int, float)] = list[N]type Sorted[T: Comparable] = list[T]The compiler reports:
tp0220_alias.tpn:2:18: error TP0220: constraints are only supported on functionstp0220_alias.tpn:3:16: error TP0220: bounds are only supported on functionsThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.