skiptools / skip

Skip transpiler for creating SwiftUI apps for iOS and Android

Home Page:https://skip.tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@Binding keypath broken in recent releases

pnewell opened this issue · comments

I am now receiving errors when referencing a binding property using key paths. It throws an error in Kotlin, Unresolved reference: name for the line with TextField in the example below. I went back to run things against a couple versions of skip, and I was able to verify things work fine up until (and including) version 0.7.31, and began erroring from version 0.7.32 onward.

Basic example:

struct Item {
    var name: String
}

public struct ContentView: View {
    @State var item: Item = Item(name: "New Item")
    
    public var body: some View {
        BindingView(item: $item)
    }
}


public struct BindingView: View {
    @Binding var item: Item
    
    public var body: some View {
        Section {
            HStack {
                TextField("", text: $item.name)
            }
        }
    }
}

Fixed in Skip 0.7.37