C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
調査の方向性
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 の本文から書いたものです。
説明
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
ParameterizedTypeof 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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeLaser/maddi のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CodeLaser/maddi#166 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
build/ci good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
CodeLaser/maddi の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
521xueweihan/HelloGitHub#4105 ·
-
Awaiting further input from submitter
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
code-maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信