T101errorwarning

Type mismatch

A value's type does not match the type expected where it is used.

It is an error when a function argument has the wrong type or a ternary's two outcomes have incompatible types. It is a warning when an array or object literal mixes element types, or when a field is read through a pointer that may be nil, which is then checked at runtime.

Convert the value to the expected type, or make the elements of the literal share one type.

$ piko explain T101

Build output ends each diagnostic with a link to this page, and editors using the Piko language server link the code under the squiggle. Look for CodeTypeMismatch in Piko's source to see where it is reported.