ArkScript-lang / ArkScript-lang/Ark

Unexpected module resolution

Abierto
#712 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
728
Forks
54
Merge medio
4 h 8 min
PR fusionados (30 d)
2

Descripción

### 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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza ejecutando ambos ejemplos de importación en ArkScript 4.7.2 y siguiendo cómo el orden de importación resuelve los nombres no cualificados. Compara la resolución de `max` con el `list:max` importado explícitamente y el `math:max` cualificado. Se considera terminado cuando ambos ejemplos resuelvan `max` como `list:max` independientemente del orden de importación.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp
Área
compilers
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
65/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.