Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)

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

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

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

評価

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

調査の方向性

The fix spans two places the payload names: the front end, where the ParameterizedType of an inner class use must carry the outer type's arguments (javac keeps them on the ClassType's enclosing type), and the C# printer, which currently writes ElementAwareArrayList.Entry. Start by reproducing the Holder.Store<T>.Entry sample and checking the printed output of private Store<String>.Entry cached;. Done means it prints Holder.Store<string>.Entry and a nested type inside Store<T> stays simple, with no CS0426 in the timefold cases.

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

説明

front-end:csharp

Problem

A class nested in a generic class, used from outside it, needs the outer class's type arguments in C#: Java's
ElementAwareArrayList<Mapped_>.Entry is C#'s ElementAwareArrayList<Mapped_>.Entry. The CST's ParameterizedType
of Entry does not carry the outer type's arguments, so the C# printer writes ElementAwareArrayList.Entry, which
names the non-generic companion class of the static members, where there is no Entry (CS0426).

In timefold this is 5 errors (AbstractToListSlot, AbstractToCollectionSlot, AbstractLeftDatasetInstance,
RandomAccessLeafIndexer). A smaller sample:

public class Holder {
    static final class Store<T> {
        final class Entry { }
        Entry add(T value) { return new Entry(); }
    }
    private Store<String>.Entry cached;
    void keep(Store<String> store) { cached = store.add("x"); }
}

prints private Holder.Store.Entry cached; (wanted: Holder.Store<string>.Entry), and also qualifies Entry
inside Store<T> itself as Holder.Store.Entry, where plain Entry (or Store<T>.Entry) would do.

What is needed

  • front end: the outer type's arguments on the ParameterizedType of an inner class's use (javac has them on the
    ClassType's enclosing type);
  • C# printer: print them, Outer<A>.Inner, and inside the generic class leave a nested type simple.

Part of #115.

主要言語
Java
スター
1
フォーク
1
平均マージ
1時間 34分
マージ済み PR(30日)
7

環境構築

はじめの一歩

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

CodeLaser/maddi のほかの issue

CodeLaser/maddi の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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