[BUG]: Error message about `fn` not contextual

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

メンテナーはふだん 2 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
領域
compilers

調査の方向性

The report concerns how Mojo handles the removed fn keyword when it appears as a variable, but it does not identify a source file or test. Start by searching the compiler and parser tests for the diagnostic text 'fn' has been removed; use 'def' instead, then trace which context triggers it. Done means the example using var fn no longer reports the migration error while deprecated fn syntax still does.

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

説明

bug bug_feature_triaged mojo Team: Mojo Compiler
Bug description

Previously I know Mojo used fn to define functions and it has been depreciated replaced with def. There is an issue when using the word fn as a variable

Actual behavior

Error is being reported in the wrong context

var fn = some_function_returning_a_function()

Error: 'fn' has been removed; use 'def' instead

Expected behavior

It should not report an error because it is a variable in this context

System information
System
------------
       Pixi version: 0.81.0
        TLS backend: rustls
           Platform: osx-arm64
   Virtual packages: __unix=0=0
                   : __osx=26.6.2=0
                   : __archspec=1=m4
          Cache dir: /Users/king/Library/Caches/rattler/cache
       Auth storage: /Users/king/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /Users/king/.pixi/bin
    Environment dir: /Users/king/.pixi/envs
       Manifest dir: /Users/king/.pixi/manifests/pixi-global.toml

PS: I will like to work on this.

主要言語
Mojo
スター
30.2k
フォーク
3.2k
平均マージ
5日 18時間
マージ済み PR(30日)
27

環境構築

はじめの一歩

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

modular/modular のほかの issue

modular/modular の issue をすべて見る

似ている issue

Compilers の issue をもっと見る

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

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