rascal
rascal copied to clipboard
Inaccurate error message about IsDefined operator may cause confusion
Describe the bug
Is defined operator
?can only be applied to a keyword parameter
This is not true. It can be used on positional field names as well, and on map keys and I believe even domain elements of relations.
constructor.fieldName?
myMap[myKey]?
myRel[myDomain]?
myList[myIndex]?
Perhaps even more?
It can not be used on pure variable names however.
Perhaps it can be used to check assignment of default values of keyword parameters of functions, but I'm pretty sure that's not a feature of the interpreter anymore. For keyword fields of ADTs, yes.