Generated equals may not override `Any#equals`
- Dominant language
- Kotlin
- Stars
- 591
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Some libraries, in this case `js-joda`, declare their equals methods as taking (TypeScript) `any`. This results in the Kotlin stub function `override fun equals(other: Any): Boolean`, however this doesn't actually override `Any#equals` which is defined as nullable: `fun equals(other: Any?): Boolean`. I think the correct behavior here would be to emit `other: Any?` in the stub, since TypeScript's `any` type may be null/undefined as well.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how TypeScript `any` is mapped to Kotlin parameter types and where generated `equals` declarations are emitted. Reproduce the conversion for the `js-joda` declarations, then verify that the generated signature uses nullable `Any?` and correctly overrides Kotlin `Any#equals`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, typescript
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100