Thanks to visit codestin.com
Credit goes to github.com

Skip to content

--trace mode leads to re-evaluation of the aliasing (->) operator #460

@lucat1

Description

@lucat1

Describe the bug
When using --trace to interpret a piece of code which uses aliasing, the behaviour differs from the standard execution mode. When aliasing gloal.test.(k) the node at global.test.(k).(k) gets created. This doesn't happen without tracing. When writing, the behaviour is as expected.

To Reproduce
Run the following snippet of code with or without --trace.

from console import Console
from string_utils import StringUtils

service Main {
  embed Console as Console
  embed StringUtils as StringUtils

  main {
    key = "k"
    valueToPrettyString@StringUtils(global)(t)
    println@Console("before aliasing: " + t )()

    test -> global.test.(key)

    valueToPrettyString@StringUtils(global)(t)
    println@Console("after aliasing: " + t )()

    test = 1

    valueToPrettyString@StringUtils(global)(t)
    println@Console("after write: " + t )()
  }
}

Expected behavior
The tracing behaviour should match the stadard one.

Desktop (please complete the following information):

  • OS: Linux (both Docker and native)
  • Jolie version: lastest master or docker's alpine-edge
  • Java Version: 20.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions