TP0206
Error: cannot infer type of empty collection
Messages
Section titled “Messages”cannot infer the type of '<f>', with helpgive it a type, e.g. 'let f: Callable[[…], …] = <f>'(a generic function, built-in or constructor as a value, M40)cannot infer the type of an empty list... empty dictcannot infer the type of Nonecannot infer '<T>' for '<f>'cannot infer the type of lambda parameter '<x>', with helpadd a type annotation
Example
Section titled “Example”From the golden case tests/cases/m35/tp0206_set.tpn:
# An empty set needs an expected type, as [] does (SPEC §3.15).let s = set()The compiler reports:
tp0206_set.tpn:2:9: error TP0206: cannot infer the type of an empty set help: add a type annotationThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.