Skip to content

Complex generic constraints can't be overridden with SKIP DECLARE #432

@dfabulich

Description

@dfabulich

Regarding skiptools/skip-ui#210 I was unable to get this declaration to transpile:

// SKIP DECLARE: public fun <K: PreferenceKey<V>, V: Any> View.onPreferenceChange(key: KClass<K>, perform: (V) -> Unit): View
public func onPreferenceChange<K>(
        _ key: K.Type = K.self,
        perform action: @escaping (
            K.Value
        ) -> Void
    ) -> some View where K : PreferenceKey, K.Value : Equatable {

The transpiler kept objecting to the K.Value : Equatable clause of the where. That would be fine if the SKIP DECLARE comment would allow me to use an alternate declaration, but Skip refused to transpile this code even with SKIP DECLARE.

IMO, SKIP DECLARE should make the transpiler stop complaining about the declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    transpilationIssues around transpilation from Swift to Kotlin (Skip Lite)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions