Conforming to a generic type with associated type error: Type parameter ID of 'Identifiable' has inconsistent values: Long, [Error type: Unresolved type for ID]
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.2k
- Forks
- 106
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
The swift:
protocol SQLRow : Identifiable {
}
public struct DataItem : Identifiable {
public typealias ID = Int64
public let id: ID
public init(id: ID) {
self.id = id
}
}
extension DataItem : SQLRow {
}
transpiles to the Kotlin:
class DataItem: Identifiable<Long>, SQLRow<ID>, MutableStruct {
override val id: Long
}
internal interface SQLRow<ID>: Identifiable<ID> {
}
Which fails to compile:
Type parameter ID of 'Identifiable' has inconsistent values: Long, [Error type: Unresolved type for ID]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Swift example and inspecting the generated Kotlin for DataItem, SQLRow, and Identifiable. Trace how the associated ID type is translated, then verify that the generated declarations compile without the inconsistent type-parameter error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, swift
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100