rhx / SwiftGtk

A Swift wrapper around gtk-3.x and gtk-4.x that is largely auto-generated from gobject-introspection
https://rhx.github.io/SwiftGtk/
BSD 2-Clause "Simplified" License
317 stars 26 forks source link

Ubuntu gtk4 missing `@escaping` annotation #57

Closed MasterBel2 closed 1 year ago

MasterBel2 commented 1 year ago
/home/masterbel2/Documents/Dev/LinuxLobby/.build/plugins/outputs/swiftgio/GIO/gir2swift-plugin/gir2swift-generated/GIO/Gio-2.0-L.swift:1794:94: error: passing non-escaping parameter 'equalFunc' to function expecting an @escaping closure
        let result = g_list_store_find_with_equal_func_full(list_store_ptr, item.object_ptr, equalFunc, userData, position)
                                                                                             ^
/home/masterbel2/Documents/Dev/LinuxLobby/.build/plugins/outputs/swiftgio/GIO/gir2swift-plugin/gir2swift-generated/GIO/Gio-2.0-L.swift:1793:108: note: parameter 'equalFunc' is implicitly non-escaping
    @inlinable func findWithEqualFuncFull<GObjectObjectT: GLibObject.ObjectProtocol>(item: GObjectObjectT, equalFunc: GEqualFuncFull, userData: gpointer? = nil, position: UnsafeMutablePointer<guint>! = nil) -> Bool {
                                                                                                           ^
                                                                                                                      @escaping

Branch: gtk4 Ubuntu 22.10 GTK version: 4.8.1+ds-1ubuntu1

rhx commented 1 year ago

I have been trying to reproduce this problem, but this works fine for me. The only thing I noticed was that there were some libraries missing in the README.md that needed to be installed. I have updated the documentation now, so maybe try the updated apt get that's in the README file now and see if this changes anything (don't forget to rm -rf .build first).

Which branch did you try this on? Both gtk4 and gtk4-monorepo (as well as gtk4-development) work fine for me. Also, which version of Swift did you try this with?

MasterBel2 commented 1 year ago

Sorry for taking so long to get back to this. I've just tried to reproduce this issue from my end too, and everything's working fine (?!). Makes me wonder if a simple machine restart would have fixed it? I'll try that next time I get something like this.