ArkScript-lang / ArkScript-lang/Ark
Unexpected module resolution
- Lingua principale
- C++
- Stelle
- 728
- Fork
- 54
- Merge medio
- 4h 8m
- PR unite (30g)
- 2
Descrizione
### What happened?
```
(import std.Prelude)
(import std.List:*)
(print (max [1 2]))
```
```
(import std.Prelude)
(import std.List :max)
(print (max [1 2]))
```
In both these examples, I would expect `max` to be `list:max`, but instead it's `math:max`. I find that confusing, because `math:max` is not defined nor imported without the prefix in either module.
Both examples work as I'd expect (`max` resolving to `math:max`--EDIT: `list:max`, sorry!) if the order of imports is reversed.
### What ArkScript version are you seeing the problem on?
4.7.2
### Operating System
Linux
### Compiler used
None
### Compiler version used
_No response_
### Relevant code & log output
```shell
ArityError: When calling `(math:max [1 2])', received 1 argument, but expected 2: `(math:max _a _b)'
At IP: 597, PP: 0, SP: 3
exit status 1
```
### Documentation
- [x] I have read existing related documentation before submitting this report
- [x] I have searched for an existing issue before posting
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia eseguendo entrambi gli esempi di importazione su ArkScript 4.7.2 e tracciando il modo in cui l’ordine delle importazioni risolve i nomi non qualificati. Confronta la risoluzione di `max` con `list:max` importato esplicitamente e `math:max` qualificato. Il lavoro è completato quando entrambi gli esempi risolvono `max` in `list:max` indipendentemente dall’ordine delle importazioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 65/100