Unexpected module resolution

オープン
#712 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

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

調査の方向性

まず、ArkScript 4.7.2 で両方の import 例を実行し、import の順序によって修飾されていない名前がどのように解決されるかを追跡します。max の解決を、明示的に import された list:max および修飾された math:max と比較します。両方の例で、import の順序に関係なく maxlist:max に解決されれば完了です。

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

説明

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
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
  • I have read existing related documentation before submitting this report
  • I have searched for an existing issue before posting
主要言語
C++
スター
729
フォーク
54
平均マージ
4時間 8分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ArkScript-lang/Ark のほかの issue

ArkScript-lang/Ark の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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