File tree Expand file tree Collapse file tree 1 file changed +21
-20
lines changed
Sources/SpyableMacro/Factories Expand file tree Collapse file tree 1 file changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -45,34 +45,35 @@ struct ReturnValueFactory {
4545 /*
4646 func f() -> String?
4747 */
48- let typeAnnotation = if functionReturnType. is ( OptionalTypeSyntax . self) {
49- TypeAnnotationSyntax ( type: functionReturnType)
50- /*
48+ let typeAnnotation =
49+ if functionReturnType. is ( OptionalTypeSyntax . self) {
50+ TypeAnnotationSyntax ( type: functionReturnType)
51+ /*
5152 func f() -> String!
5253 */
53- } else if functionReturnType. is ( ImplicitlyUnwrappedOptionalTypeSyntax . self) {
54- TypeAnnotationSyntax ( type: functionReturnType)
55- /*
54+ } else if functionReturnType. is ( ImplicitlyUnwrappedOptionalTypeSyntax . self) {
55+ TypeAnnotationSyntax ( type: functionReturnType)
56+ /*
5657 func f() -> any Codable
5758 */
58- } else if functionReturnType. is ( SomeOrAnyTypeSyntax . self) {
59- TypeAnnotationSyntax (
60- type: ImplicitlyUnwrappedOptionalTypeSyntax (
61- wrappedType: TupleTypeSyntax (
62- elements: TupleTypeElementListSyntax {
63- TupleTypeElementSyntax ( type: functionReturnType)
64- }
59+ } else if functionReturnType. is ( SomeOrAnyTypeSyntax . self) {
60+ TypeAnnotationSyntax (
61+ type: ImplicitlyUnwrappedOptionalTypeSyntax (
62+ wrappedType: TupleTypeSyntax (
63+ elements: TupleTypeElementListSyntax {
64+ TupleTypeElementSyntax ( type: functionReturnType)
65+ }
66+ )
6567 )
6668 )
67- )
68- /*
69+ /*
6970 func f() -> String
7071 */
71- } else {
72- TypeAnnotationSyntax (
73- type: ImplicitlyUnwrappedOptionalTypeSyntax ( wrappedType: functionReturnType)
74- )
75- }
72+ } else {
73+ TypeAnnotationSyntax (
74+ type: ImplicitlyUnwrappedOptionalTypeSyntax ( wrappedType: functionReturnType)
75+ )
76+ }
7677
7778 return try VariableDeclSyntax (
7879 """
You can’t perform that action at this time.
0 commit comments