ArkScript-lang / ArkScript-lang/Ark

Unexpected module resolution

オープン
#712 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
728
フォーク
54
平均マージ
4時間 8分
マージ済み PR(30日)
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` の解決を、明示的に import された `list:max` および修飾された `math:max` と比較します。両方の例で、import の順序に関係なく `max` が `list:max` に解決されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
compilers
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。