`-flatten` reports a false clash between a directory and a same-named file
- Dominant language
- APL
- Stars
- 26
- Forks
- 11
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
With `-flatten`, subdirectories never become namespaces, but `U.FixFiles` still gives each directory an APL name before its clash check. A directory and a same-named function or script therefore block the whole link.
## Reproduce
```text
A: foo.aplf foo/code.aplf
B: foo/foo.aplf bar.aplf
C: util.apln util/x.aplf
```
```apl
]link.create #.x -flatten -source=dir
⎕SE.Link.Create: Files produce clashing APL names:
/foo.aplf ←→ #.x.foo
/foo/ ←→ #.x.foo
```
B and C fail the same way (`foo/` vs `foo/foo.aplf`; `util.apln` vs `util/`). Without `-flatten`, B links fine and A and C are genuine clashes.
## Expected
| Layout | Names in `#.x` with `-flatten` |
|---|---|
| A | `foo` `code` |
| B | `foo` `bar` |
| C | `util` (script) `x` |
Two *files* defining the same flattened name (`a/Foo.aplf` + `b/Foo.aplf`) must still error.
## Fix
`Utils.apln:1338-1348` (`FixFiles`): exclude directory entries from `allnames` before the clash check when `opts.flatten` is set. Do not simply delete the rows: they also drive per-directory loading and the early load of `quadVars.apln` (`:1395-1421`). Check the `fastLoad` branch (`:1336-1340`, late clash check at `:1446`) and the two "mismatch between unscripted namespaces and directories" checks (`:1403`, `:1423`).
## Tests
Add to `Test/test_flattened.aplf`: A, B, C link with the names above; `a/Foo.aplf` + `b/Foo.aplf` still errors; B still works and A, C still fail without flatten; repeat with `fastLoad`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.