Stream: shorthand
Topic: alias
David Hay (Jan 08 2020 at 04:08):
Assuming I define an Alias (systemCPN) , should I be able to use it like this:
* identifier[0].system = systemCPN
Right now it generates the error:
error: mismatched input 'systemCPN' expecting {'true', 'false', STRING, MULTILINE_STRING, NUMBER, CODE, DATETIME, TIME}
Nick Freiter (Jan 08 2020 at 13:38):
Right now, no you can't use the alias like that. When you are using =
to set a value, SUSHI is going to expect true
, false
, a string, a number, a code, a dateTime, or a time, and systemCPN
doesn't match any of those, so we get this input error. The solution here for now would be to just to manually replace the aliased value with the desired string.
I think this brings up a good point though, we likely need to expand where we allow aliases. I can't think of any good reasons why you shouldn't be able to use an alias here, and the rules for where an alias can and can't probably seem a bit arbitrary.
Last updated: Apr 12 2022 at 19:14 UTC