-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
Description
Describe the bug
It's possible to mistakenly interpolate value into Amber string the following way: "\$variable". This shouldn't be allowed as it creates a lot of potential issues.
To Reproduce
This snippet will interpolate not only the variable name, but also the value that it contains:
amber -e 'let var = 42; echo "\${nameof var}"';
It happens because with interpolation we evaluate this amber code to this bash output:
var=42
echo "$var"And then it returns 42
Expected behavior
The example written above should compile to:
var=42
echo "\$var"And return $var as it should
Additional context
N/A
lens0021