C# printer: a self-bounded interface's wildcard interface and companion class share a name (CS0102)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
調査の方向性
Start with the TestJavaToCSharpStructure.wildcardInterfaces case and its wildcardInterfaces-Lifecycles.cs golden file. Check how the C# printer emits wildcard interfaces and companion statics, then choose one of the two fixes described in the issue and update the assertion. Done means the generated C# has no duplicate IImpacter declaration and the structure test expects the chosen output.
索引モデルが issue の本文から書いたものです。
説明
A generic interface whose type parameter is self-bounded, with a static method, gets both a wildcard interface (CSharpWildcardInterfaces) and a companion class for its statics. Both are named after the non-generic interface, so C# rejects the type (CS0102).
Java, from TestJavaToCSharpStructure.wildcardInterfaces (LIFECYCLES):
public interface Grade<G extends Grade<G>> { }
public interface Impacter<G extends Grade<G>> {
java.util.List<G> impacts();
static <G extends Grade<G>> Impacter<G> none() { return null; }
}
static int impacts(Impacter<?> impacter) { return impacter.impacts().size(); }
C#, from the golden file wildcardInterfaces-Lifecycles.cs:
public interface IImpacter<G> : IImpacter where G : IGrade<G> { ... }
public interface IImpacter { }
public static class IImpacter { public static IImpacter None() => null; }
Roslyn: error CS0102: The type 'Lifecycles' already contains a definition for 'IImpacter'.
For a type that isn't self-bounded, the companion's statics go into the wildcard interface itself (ITupleLifecycle.Same). The test's comment, "a self-bounded interface with a companion keeps both, as before the companion became the wildcard interface", and its assertion public static class IImpacter { both expect this output. So the golden file has never compiled, and the structure tests don't compile their golden files.
Possible fixes:
- Put the statics into the wildcard interface here too, as static interface members.
- Give the companion class another name.
Whichever is chosen, the test's assertion needs to change with it.
- 主要言語
- Java
- スター
- 1
- フォーク
- 1
- 平均マージ
- 1時間 58分
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeLaser/maddi のほかの issue
-
build/ci good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug front-end:javac
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
CodeLaser/maddi#145 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)オープンfront-end:csharp
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
CodeLaser/maddi の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QuiltMC/update-quilt-meta#28 ·
-
awaiting triage Documentation P3
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
area/build area/maintainability component/camunda-process-test kind/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToList対応中かも @mohamed-elbrik が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area/kotlin
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信