MobileNativeFoundation / swift-index-store

Library to read from Swift / clang source code indexes
Apache License 2.0
137 stars 12 forks source link

Fix C API calls #45

Closed keith closed 1 year ago

keith commented 1 year ago

With Swift 5.9 our uses of the index C APIs warned with:

.../Sources/IndexStore/IndexStore.swift:299:66: warning: forming 'UnsafeMutableRawPointer' to a variable of type '(SymbolOccurrence, (Symbol, SymbolRoles) -> ())'; this is likely incorrect because '(SymbolOccurrence, (Symbol, SymbolRoles) -> ())' may contain an object reference.

And in our case things definitely contained object references. Assuming this warning is valid I guess we were just lucky with our usage before. Now we pass through a Context object that handles the state for us instead.

keith commented 1 year ago

going to try and go with https://github.com/lyft/swift-index-store/pull/48 instead