Add an option to copy positions from old tree when doing substitutions#107
Add an option to copy positions from old tree when doing substitutions#107jad-hamza wants to merge 2 commits intoepfl-lara:scala-2.13from
Conversation
a8ad7ae to
ce17562
Compare
|
Reminder: Revert epfl-lara/stainless@a2f2600 when this is released. |
|
I'm not sure this really makes sense as you'll only copy the position over for the top-level substituted expression and not its children. What is your use case? Maybe it would make more sense to use a custom transformer? |
|
I don’t know the specific use-/testcase Jad had in mind, but he indeed ended up using a custom transformer in epfl-lara/stainless@a2f2600 FYI |
|
Right, I needed it so that we don't lose the positions when substituting a variable with a new variable
Yes that's true, it's a bit weird having it in the general case. Should we move |
|
@jad-hamza , is this still relevant? Is it for error reporting of positions? |
|
Yes it's useful when you're freshening variables to maintain positions. Normal substitution will substitute all variables (which are at different position) by just one instance of a variable (which has a single position). Now that I look at my code again in Stainless, I wonder how it was supposed to work. The function is still replacing with one single instance, instead of cloning the variable. Edit: we can close here and address this in Stainless if this function is not needed in Inox |
No description provided.