ArkScript-lang / ArkScript-lang/Ark
Unexpected module resolution
- Langage dominant
- C++
- Étoiles
- 728
- Forks
- 54
- Merge moyen
- 4 h 8 min
- PR mergées (30 j)
- 2
Description
### 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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par exécuter les deux exemples d’importation sur ArkScript 4.7.2 et retracez la manière dont l’ordre des importations résout les noms non qualifiés. Comparez la résolution de `max` avec `list:max` importé explicitement et `math:max` qualifié. C’est terminé lorsque les deux exemples résolvent `max` en `list:max`, quel que soit l’ordre des importations.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp
- Domaine
- compilers
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 65/100