ArkScript-lang / ArkScript-lang/Ark
Unexpected module resolution
- 主要语言
- C++
- 星标
- 728
- 派生
- 54
- 平均合并
- 4 小时 8 分钟
- 30 天内合并 PR
- 2
描述
### 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
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先在 ArkScript 4.7.2 上运行两个 import 示例,并跟踪 import 顺序如何解析未限定名称。比较 `max` 的解析结果与显式导入的 `list:max` 以及限定的 `math:max`。完成标准是:无论 import 顺序如何,两个示例都将 `max` 解析为 `list:max`。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 65/100