RX0004

Domain: Parser

Error message

parameter type mismatch: expected %s, got %s

In the message, %s marks a value that the engine fills in when it raises the error.

The story

You called a builtin and the engine said the types do not match, expecting one thing and getting another. And notice when this happens: at parse time, before a single line runs. The engine reads your script, checks every call against the declared parameter types, and stops right there if something is off. That is a good thing, because nothing has happened yet, no output, no side effects, nothing to clean up. The message names two types. The first is what the builtin asked for. The second is what you actually handed it. Imagine ordering a coffee and being handed a sandwich: the barista does not guess, they just say that is not what I asked for. Say a builtin wants a number and you pass the word banana. The engine refuses. The fix is to look at the call and ask what kind of value belongs in that slot. Convert it, or pass the right thing. If the type looks right to you, double check where the value comes from, because a variable can carry a different kind than you remember. Same rule everywhere: the declared type is the contract, and the contract is checked before anything runs.

Text from the Rush engine's error catalogue.