jextract/jni: Enum case record names can collide with enclosing types

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

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

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

評価

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

調査の方向性

Read the jextract/jni enum extraction code and its generated Java output for the Message example. Trace how Swift case names determine record names, payload accessors, and case dispatch; check the generated output with a case that collides with an enclosing type. Done means the generated record avoids the collision and its accessor and dispatch names stay consistent.

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

説明

Problem

JNI enum extraction capitalizes each Swift case name to generate a nested Java record. That record can have the same name as its enum, another enclosing type, or the generated Case interface. Java rejects these declarations because a nested type cannot share an enclosing type's name.

Example

public enum Message {
  case message(Int64)
}

The generated Java code contains a record named Message inside Message.Case. This conflicts with the enclosing Message type and causes Java compilation to fail.

The generated record name should avoid collisions with enclosing types. Its payload accessor and case dispatch should use the same name consistently.

Reference workaround implementation: https://github.com/qoncept/swift-java/pull/7

主要言語
Swift
スター
1.3k
フォーク
127
平均マージ
2日 14時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

swiftlang/swift-java のほかの issue

swiftlang/swift-java の issue をすべて見る

似ている issue

Swift の issue をもっと見る

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

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