Skip to content

Namespace structure is destroyed if repeatedly trace and edit a method in a deeply nested linked namespace #751

@dyavc

Description

@dyavc

Describe the bug
Namespace structure is destroyed if repeatedly trace and edit a method in a deeply nested linked namespace

To Reproduce
PREP:
copy attached zip file to c:\tmp\ and unzip it there.
This creates a subdirectory dir751 in c:\tmp

dir751.zip
c:\tmp\dir751\repro.apln contains the following:
:NameSpace Repro
:NameSpace NS2
:NameSpace NS3
∇ r←ns3Main
r←'hey there!'

:EndNamespace
:EndNamespace
:endnamespace

REPRO:
⍝ in Dyalog:
]link.create # c:\tmp\dir751

⍝ Run the following with ctrl + enter:
Repro.NS2.NS3.ns3Main

⍝ Edit the r← line before it executes, and change the text to something else
⍝ Press continue execution
⍝ Note that the result is still 'Hey there!' even though you have edited the file. This behaviour exists for all nested namespaces that are depth 2 or more
⍝ Repeat steps 2, 3 and 4 again, and note the following printed to the session: Link Warning: ⎕SE.Link.OnAfterFix: No source for #.Repro.NS2.Repro
⍝ Note that now the nested namespace structure is gone, and instead, both ns3Main and ns4Main are now in #.Repro, and there is no longer a NS2 namespace in #.Repro

Repro.NS2.NS3.ns3Main
VALUE ERROR: Undefined name: NS3
Repro.NS2.NS3.ns3Main

Expected behaviour
The namespace hierarchy not to be destroyed.

Session transcript
]link.create # D:\tmp\dir751
Linked: # ←→ "D:\tmp\dir751"
Repro.NS2.NS3.ns3Main
hey there!
Repro.NS2.NS3.ns3Main
Link Warning: ⎕SE.Link.OnAfterFix: No source for #.Repro.NS2.Repro
hey there 1 2!
Repro.NS2.NS3.ns3Main
VALUE ERROR: Undefined name: NS3
Repro.NS2.NS3.ns3Main

Desktop (please complete the following information):

Additional context
]tools.version
Dyalog 20.0.53006 64-bit Unicode, BuildID df0c7c9e
OS Windows 10 or Windows Server 2016 (10.0.19045) 64-bit
Link 4.1.6
SALT 2.915
UCMD 2.7
.NET .NET 8.0.23
WS 20.0
Tatin 0.122.0
Cider 0.49.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions