link icon indicating copy to clipboard operation
link copied to clipboard

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

Open dyavc opened this issue 10 months ago • 2 comments

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

dyavc avatar Jan 15 '26 13:01 dyavc

Holden found this one, so he is best placed to supply more info.

JD says "I suspect that 22741 is a LINK issue, if I just ⎕FIX the file, I think it’s OK (Holden says the same, Vince, perhaps you could try that too)."

dyaandys avatar Jan 16 '26 09:01 dyaandys

I too suspect it's a LINK issue. If you just ⎕FIX the file, or paste the file contents in the session as a multiline input, the issue does not occur.

Bombardier-C-Kram avatar Jan 16 '26 11:01 Bombardier-C-Kram