You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A function that returns an optional Foo must be written:
func buildFoo<T>() -> Optional<any Foo<T>>
But the syntactic_sugar rule autocorrects this to:
func buildFoo<T>() -> any Foo<T>?
Which results in the compiler error:
use of protocol Foo<Bar>? must be written Optional<any Foo<Bar>>
To address this, the syntactic_sugar rule should not suggest this correction for optionals with an existential after their opening angle bracket (some or any).
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Describe the bug
Protocols with primary associated types used as optional return values cannot use the ? syntactic sugar.
Given:
A function that returns an optional Foo must be written:
But the syntactic_sugar rule autocorrects this to:
Which results in the compiler error:
To address this, the syntactic_sugar rule should not suggest this correction for optionals with an existential after their opening angle bracket (some or any).
The text was updated successfully, but these errors were encountered: