quint
quint copied to clipboard
Consider corner cases in namespace manipulation for flattening
From https://github.com/informalsystems/quint/pull/1109#discussion_r1298194884
I think the solution here is to change the importedFrom
field to a list, keep track of the path of imports there, get rid of namespaces
, and then find out the namespaces for a definition from the list of importedFrom
field.
An example (and perhaps the only) scenario where we need the startsWith
check is:
- We have a qualified instance
- The namespace for the instance is then
myModule::A1
- The name for some definition referencing the instance is
A1::foo
- When we add namespaces
['A1', 'myModule']
toA1::foo
, I'd like it[^1] to becomemyModule::A1::foo
.
Hopefully this will be trivial to solve when everything else is in place and I can test the interaction of changes in namespace manipulation and flattening on our set of examples.
[^1]: I'd like it in the sense that we probably don't need to, but it is more cognitively consistent and easier to explain if it behaves like this.