In some cases, the global character of a value was lost, leading to undefined behaviour. Now a node level field of -1 means that the value is global, and that it should be accessed from the root data frame. Fixes #993.
16 lines
110 B
Go
16 lines
110 B
Go
package main
|
|
|
|
var a int = 2
|
|
|
|
func inca() {
|
|
a = a + 1
|
|
}
|
|
|
|
func main() {
|
|
inca()
|
|
println(a)
|
|
}
|
|
|
|
// Output:
|
|
// 3
|