You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you extend the source code so that I can reproduce the error?
EDIT:
I just read your example again. String interpolation doesn't work in macro/template context. This is a known problem. Use string concatenation or the format proc instead, sorry for the inconvenience.
When closing as a duplicate it would be good to link to it: #7632
timotheecour
changed the title
String interpolation raises undeclared identifier but identifier is in scope
String interpolation (eg fmt) raises undeclared identifier but identifier is in scope
Oct 30, 2018
I have a macro generating code:
tableName
is a const at the top-level that has been generated elsewhere.What happens
What happens is the interpolation in
find
fails withError: undeclared identifier: 'tableName'
. The interpolation ininsert
works just fine.What I expect to happen
What I expect to happen is that the value of
tableName
is inserted into the string forfind
(just as it is successfully is forinsert
.Possible Solution
If you first assign the constant to anther local variable (jumping thru all the ident quoting hoops) and then try to interpolate it it will work.
IE:
This makes working with interpolation in macros crazy cumbersome though. I'm hoping I'm mising something.
Additional Information
I found and tried
-d:debugFmtDsl
but it didn't reveal anything I thought would be useful.The text was updated successfully, but these errors were encountered: