C#: an interface's nested types are printed unqualified outside the interface (CS0246)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start in CSharpTypeName.name around lines 507–518 and compare its qualification logic with CSharpTypeName.inHeader, which the issue says emits the expected qualified names for the lambda adapter. Reproduce the reported Plain and Use cases or use the PromptTemplateFactory corpus example; done means generated C# qualifies nested interface types as IFactory.ITemplate and IFactory.IInput so the reported compiler errors are resolved.
索引モデルが issue の本文から書いたものです。
説明
Found while adding the variance tests (ws/maddi-csharp, after b13471627). A class that names a nested type of an interface prints the simple name, which C# does not resolve outside the interface:
interface Factory {
interface Input { }
interface Template { }
Template create(Input in);
}
class Plain implements Factory {
public Template create(Input in) { return null; } // Java: member types inherited from the interface
}
class Use {
static Factory make(Factory.Template t) { return in -> t; } // Java: explicitly qualified
}
prints
internal sealed class Plain : IFactory { public ITemplate Create(IInput @in) => null; } // CS0246 ×2, CS0535
internal sealed class Use { internal static IFactory Make(ITemplate t) => new FactoryLambda(@in => t); } // CS0246
Expected IFactory.ITemplate / IFactory.IInput, as the lambda adapter beside the interface now prints them (CSharpTypeName.inHeader). C# does not inherit member types from interfaces, so an implementing class needs the qualification as much as an unrelated one. Probably the Qualification treating the nested types as in scope by their simple name; CSharpTypeName.name lines ~507-518.
In the corpus: dev/langchain4j/spi/prompt/PromptTemplateFactory (IInput, ITemplate).
- 主要言語
- Java
- スター
- 1
- フォーク
- 1
- 平均マージ
- 1時間 13分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeLaser/maddi のほかの issue
-
Javadoc warnings are the only noise on an otherwise clean CI run対応中かも @jayeshamundkar06-bit が 4 日前に担当しました。 オープンbuild/ci good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
CodeLaser/maddi#4 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 61/100
CodeLaser/maddi#185 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 14/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
CodeLaser/maddi の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
googleads/googleads-mobile-flutter#1541 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Julow/Unexpected-Keyboard#1490 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Vakore/ZappierGames#275 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
unitycatalog/unitycatalog#2148 ·
メンテナーはふだん 2 日以内に返信
-
enhancement priority: low
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Riptide-Labs/riptide#1060 ·
メンテナーはふだん 1 日以内に返信