TP0203
Error: optional used without narrowing (expected T, got T?)
Messages
Section titled “Messages”- help
the change to a <T> on line <n> could have changed it; copy it to a 'let' first(an element, M40) <T>? can only be matched by '_' or a binding, with help'None' patterns aren't supported yet; bind it and test it with 'is some'(a pattern, M29)expected <T>, found <T>?<T>? must be narrowed before use, with helpnarrow it with 'is some', or give a default with '??', or one saying why a name or path isn’t narrowed there (§3.9, M27)
Example
Section titled “Example”From the golden case tests/cases/m11/tp0203_functions.tpn:
var f: Callable[[], int]? = Noneprint(f())The compiler reports:
tp0203_functions.tpn:2:7: error TP0203: Callable[[], int]? must be narrowed before use help: narrow it with 'is some', or give a default with '??'The specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.