Skip to content

fix duplicated fields from superclass - #501

Merged
ktoso merged 1 commit into
swiftlang:mainfrom
untitled-in-brackets:bugfix/duplicate-properties
Jan 5, 2026
Merged

ktoso merged 1 commit into
swiftlang:mainfrom
untitled-in-brackets:bugfix/duplicate-properties

Conversation

@diederich

Copy link
Copy Markdown
Contributor

in case of duplicated properties, e.g. from a base class it was generating duplicate property definitions, e.g.:

extension JavaClass<PrivateKey> {
  @JavaStaticField(isFinal: true)
  public var serialVersionUID: Int64

  @JavaStaticField(isFinal: true)
  public var serialVersionUID: Int64
}

(see e.g. https://docs.oracle.com/javase/8/docs/api/java/security/PrivateKey.html)

which then fails the swift build.

Analog to methods, this now skips the property in case it wasn't directly from the class itself.

in case of duplicated properties, e.g. from a base class it was
generating duplicate property definitions, e.g.:

```
extension JavaClass<PrivateKey> {
  @JavaStaticField(isFinal: true)
  public var serialVersionUID: Int64

  @JavaStaticField(isFinal: true)
  public var serialVersionUID: Int64
}

```
(see e.g. https://docs.oracle.com/javase/8/docs/api/java/security/PrivateKey.html)

which then fails the swift build.

Analog to methods, this now skips the property in case it wasn't directly from
the class itself.

@ktoso ktoso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@ktoso

ktoso commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

Tested locally while we debug the macOS CI problem -- lgtm, thank you!

@ktoso
ktoso merged commit da6be2f into swiftlang:main Jan 5, 2026
93 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants