KS5020
En un archivo strict, un valor cuyo tipo el comprobador no puede demostrar. Escribe el tipo donde se declara el valor. En un archivo estricto es un error, y el script no se ejecuta hasta que se corrige:
<strict />
<let name="names" value="[]" /> <!-- error: write the item type, such as $names: string[] = [] -->
<let name="found" value="null" /> <!-- error: write its type: $found: string? = null -->
<let name="data" type="any" value="'{"n": 1}'->convert(from: json)" />
<let name="n" value="$data.n" /> <!-- error: the checker can't tell what $n holds; write $n: int = $data.n -->strict
$names = [] // error: write the item type, such as $names: string[] = []
$found = null // error: write its type: $found: string? = null
$data: any = '{"n": 1}'->convert(from: json)
$n = $data.n // error: the checker can't tell what $n holds; write $n: int = $data.nEl mismo código señala una variable que recibe valores de tipos distintos, un parámetro de lambda sin nada de donde tomar un tipo (escribe fn(n: number) => ...), una función cuyo resultado no se puede deducir (escribe fn first(items: list): string) y un campo sin tipo ni valor por defecto.