File tree 3 files changed +29
-5
lines changed
SageSwiftKitMacros/MockableMacros/Auxiliars/Builders
3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ # [ 0.2.5] - 2024-11-15
9
+
10
+ ### Fixed
11
+
12
+ - Automackable support to handle tupples
13
+
8
14
# [ 0.2.4] - 2024-11-14
9
15
10
16
### Fixed
Original file line number Diff line number Diff line change @@ -39,5 +39,7 @@ struct PlayingObject {
39
39
40
40
@AutoMockable ( )
41
41
public protocol DateSelectorViewModel {
42
- func make( ) throws -> String
42
+ var onTap : ( String , Int ? ) -> Void { get set }
43
+ var onString : String { get set }
44
+ var onDouble : Double ? { get set }
43
45
}
Original file line number Diff line number Diff line change @@ -20,17 +20,33 @@ struct ProtocolVarsConformanceBuilder {
20
20
}
21
21
22
22
var typeReturnVar : TypeAnnotationSyntax ? {
23
- guard let myType = variable. bindings. first? . typeAnnotation else {
23
+ guard let typeAnnotation = variable. bindings. first? . typeAnnotation else {
24
24
return nil
25
25
}
26
26
27
- if let optional = myType. type. as ( OptionalTypeSyntax . self) {
28
- return TypeAnnotationSyntax ( type: optional)
27
+ let type = typeAnnotation. type
28
+
29
+ if type. as ( OptionalTypeSyntax . self) != nil || type. as ( ImplicitlyUnwrappedOptionalTypeSyntax . self) != nil {
30
+ return typeAnnotation
31
+ }
32
+
33
+ if let funcType = type. as ( FunctionTypeSyntax . self) {
34
+ return TypeAnnotationSyntax (
35
+ type: ImplicitlyUnwrappedOptionalTypeSyntax (
36
+ wrappedType: TupleTypeSyntax (
37
+ elements: . init( itemsBuilder: {
38
+ TupleTypeElementSyntax (
39
+ type: funcType. trimmed
40
+ )
41
+ } )
42
+ )
43
+ )
44
+ )
29
45
}
30
46
31
47
return TypeAnnotationSyntax (
32
48
type: ImplicitlyUnwrappedOptionalTypeSyntax (
33
- wrappedType: myType . type. trimmed,
49
+ wrappedType: type. trimmed,
34
50
exclamationMark: . exclamationMarkToken( )
35
51
)
36
52
)
You can’t perform that action at this time.
0 commit comments