@@ -31,23 +31,8 @@ Action<MethodDeclarationSyntax> next
3131 || ( retNative == "bool" && current . ReturnType . ToString ( ) . Trim ( ) != "bool" ) // stdbool.h, hopefully...
3232 )
3333 {
34- current = current . WithReturnType (
35- newRetType = string . IsNullOrWhiteSpace ( retBoolScheme )
36- ? GenericName (
37- Identifier ( "MaybeBool" ) ,
38- TypeArgumentList ( SingletonSeparatedList ( current . ReturnType ) )
39- )
40- : GenericName (
41- Identifier ( "MaybeBool" ) ,
42- TypeArgumentList (
43- SeparatedList (
44- // ReSharper disable once RedundantCast <-- false positive
45- ( IEnumerable < TypeSyntax > )
46- [ current . ReturnType , IdentifierName ( retBoolScheme ) ]
47- )
48- )
49- )
50- ) ;
34+ newRetType = MaybeBoolUtils . MaybeBoolType ( current . ReturnType , retBoolScheme ) ;
35+ current = current . WithReturnType ( newRetType ) ;
5136 }
5237
5338 List < ParameterSyntax > ? @params = null ;
@@ -65,23 +50,8 @@ paramNative is not null
6550 )
6651 )
6752 {
68- ( @params ??= [ .. current . ParameterList . Parameters ] ) [ i ] = param . WithType (
69- string . IsNullOrWhiteSpace ( paramBoolScheme )
70- ? GenericName (
71- Identifier ( "MaybeBool" ) ,
72- TypeArgumentList ( SingletonSeparatedList ( param . Type ) )
73- )
74- : GenericName (
75- Identifier ( "MaybeBool" ) ,
76- TypeArgumentList (
77- SeparatedList (
78- // ReSharper disable once RedundantCast <-- false positive
79- ( IEnumerable < TypeSyntax > )
80- [ param . Type , IdentifierName ( paramBoolScheme ) ]
81- )
82- )
83- )
84- ) ;
53+ var newType = MaybeBoolUtils . MaybeBoolType ( param . Type , paramBoolScheme ) ;
54+ ( @params ??= [ .. current . ParameterList . Parameters ] ) [ i ] = param . WithType ( newType ) ;
8555 }
8656 }
8757
0 commit comments