KScript docs
EN

Error codes

KS5010

A field the value doesn't have. The records of a type only have the fields it declares.

A map written in the code is checked too. Reading a field a map doesn't have gives nothing, so a near miss of one it does have is almost always a typo:

<let name="person" value="{ name: 'Joan', age: 82 }" />
<echo value="$person.nmae" /> <!-- warning: Did you mean name? -->
<echo value="$person.email ?? '-'" /> <!-- fine: not close to a field, so it may be optional -->
$person = { name: 'Joan', age: 82 }
echo $person.nmae            // warning: Did you mean name?
echo $person.email ?? '-'    // fine: not close to a field, so it may be optional

Text and numbers have no fields at all, so $name.upper stops the script. Call the method instead: $name->upper().

The same code reports a private field or method used outside its type. Use one of the type's other methods, or take private off the member.

Edit this page on GitHub