diem/diem

[move-compiler] confusing unused alias error message for `Self` in `use` declarations

オープン

#9,848 opened on 2021/11/22

 (0 件のコメント) (0 件のリアクション) (3 人の担当者)Rust (2,579 件のフォーク)batch import
enhancementgood first issuemove-compiler

Repository metrics

Stars
 (16,698 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Consider the following error message reported by the Move compiler.

use MyPackage::MyCoin::{Self, MyCoin};
   │           ^^^^^^Unused 'use' of alias 'MyCoin'. Consider removing it

You get this message when the module has no calls to functions in MyCoin. The correct fix is removing the Self from the use declaration. But:

  • the error message mentions MyCoin, which might make the user think that's what should be deleted
  • the error message ^'s point at the ::MyCoin::, which might make the user think something needs to be changed there.

I think ideally, the ^'s would point at Self and the error message would say Self.

コントリビューターガイド