AppIntents - Issue with perform() method return types

Hi there,

I'm migrating my old Intents to the new App Intents framework.

I have an intent that always returns a dialog, but never returns a value. Therefore I define the return types for its perform method as follows:

func perform() async throws -> any IntentResult & ProvidesDialog 

When running the intent, the app crashes and the debugger indicates

AppIntents/PerformActionExecutorTask.swift:195: Fatal error: perform() returned types not declared in method signature - Did not declare ProvidesDialog but provided one

perform() returned types not declared in method signature - Did not declare ProvidesDialog but provided one

The actual expression for returning a result is written as follows:

return .result(dialog:"hello world")

I tried a few alternative return types definition with no luck.

I'm on XCode 15.0 (15A240d) and running on iOS 17.0 (21A329)

Running out of ideas...

Try to change "any" to "some"

func perform() async throws -> some IntentResult & ProvidesDialog
AppIntents - Issue with perform() method return types
 
 
Q