@Dependency property wrapper does not compile inside EntityQuery conforming struct #230
Replies: 1 comment 3 replies
-
|
Hi @twocentstudios, I believe this is because the AppIntents framework already has its own So unfortunately I believe this means you have to do: @Dependencies.Dependency(\.key) var value…when importing AppIntents. I was under the impression that when there are conflicts between a user's code and Apple's libraries that you would be forced to qualify their APIs (e.g. In any case, since this isn't an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm trying to use the
@Dependencyproperty wrapper within a struct conforming to theEntityQueryprotocol in theAppIntentsframework. Currently I'm trying to define anEntityQueryin a widget extension.I'm getting a compiler error on the
@Dependencyline in the struct body and within theinitmethod:Type of expression is ambiguous without a type annotation.Checklist
mainbranch of this package.Expected behavior
The target compiles and I can use the resolved dependency.
Actual behavior
Compiler error:
Type of expression is ambiguous without a type annotation(see code below)Steps to reproduce
Widget.swiftfileFor now, I think I can use the below workaround: using
@Dependencyin thedefaultQueryproperty of theAppEntityand passing the results manually into theAppEntityConformingModelQueryinitializer.Related docs for creating a configurable Widget that show minimal
EntityQueryandAppEntitydefinitions: https://developer.apple.com/documentation/widgetkit/making-a-configurable-widgetDependencies version information
main (3815c48) (near 1.3.1)
Destination operating system
iOS 17
Xcode version information
Version 15.4 (15F31d)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions