Dyalog / Dyalog/link

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

Open
#751 2 comments 0 reactions 0 assignees View on GitHub
bug H𝗜𝗚𝗛
Dominant language
APL
Stars
26
Forks
11
Avg merge
1d 18h
Merged PRs (30d)
1

Description

**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](https://github.com/user-attachments/files/24643873/dir751.zip)
c:\tmp\dir751\repro.apln contains the following:
```apl
: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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.