quint icon indicating copy to clipboard operation
quint copied to clipboard

State variables don't respect module namespaces

Open shonfeder opened this issue 1 year ago • 1 comments

Given

module A {
  var x: int
}

module B {
  var x: int
}

module C {
  import A
  import B
  action step = all {
    A::x' = A::x,
    B::x' = B::x,
  }
}

We get

$  quint typecheck t.qnt 
t.qnt:2:3 - error: [QNT202] Multiple updates of variable x
2:   var x: int
     ^^^^^^^^^^

t.qnt:6:3 - error: [QNT202] Multiple updates of variable x
6:   var x: int
     ^^^^^^^^^^

error: typechecking failed

But I would expect these variables to be completely distinct.

On the face of it, this looks to me like an iteration of the general namespacing motif from #1288.

shonfeder avatar Dec 07 '23 02:12 shonfeder

Oh right. My solution considered only instances, but this should also include namespaces. I'm afraid this will be more complicated to fix, tho. We'll figure something out.

bugarela avatar Dec 07 '23 11:12 bugarela