@@ -85,15 +85,16 @@ public static string WrapperOperatorName (TypeMapper typeMapper, string moduleNa
85
85
return $ "{ kXamPrefix } { classPrefix } { operatorType } { operatorName } ";
86
86
}
87
87
88
- public static string WrapperName ( SwiftClassName name , string methodName , bool isExtension )
88
+ public static string WrapperName ( SwiftClassName name , string methodName , bool isExtension , bool isStatic )
89
89
{
90
- return WrapperName ( name . ToFullyQualifiedName ( false ) , methodName , isExtension ) ;
90
+ return WrapperName ( name . ToFullyQualifiedName ( false ) , methodName , isExtension , isStatic ) ;
91
91
}
92
92
93
- public static string WrapperName ( string fullyQualifiedClassName , string methodName , bool isExtension )
93
+ public static string WrapperName ( string fullyQualifiedClassName , string methodName , bool isExtension , bool isStatic )
94
94
{
95
- string classPrefix = fullyQualifiedClassName . Replace ( '.' , 'D' ) ;
96
- return $ "{ kXamPrefix } { classPrefix } { ( isExtension ? 'E' : 'D' ) } { methodName } ";
95
+ var classPrefix = fullyQualifiedClassName . Replace ( '.' , 'D' ) ;
96
+ var separator = isExtension ? 'E' : ( isStatic ? 'd' : 'D' ) ;
97
+ return $ "{ kXamPrefix } { classPrefix } { separator } { methodName } ";
97
98
}
98
99
99
100
public static string WrapperCtorName ( SwiftClassName name , bool isExtension )
@@ -102,9 +103,9 @@ public static string WrapperCtorName (SwiftClassName name, bool isExtension)
102
103
return $ "{ kXamPrefix } { classPrefix } { ( isExtension ? 'E' : 'D' ) } { name . Terminus } ";
103
104
}
104
105
105
- public static string WrapperName ( SwiftClassName name , string methodName , PropertyType propType , bool isSubScript , bool isExtension )
106
+ public static string WrapperName ( SwiftClassName name , string methodName , PropertyType propType , bool isSubScript , bool isExtension , bool isStatic )
106
107
{
107
- return WrapperName ( name . ToFullyQualifiedName ( ) , methodName , propType , isSubScript , isExtension ) ;
108
+ return WrapperName ( name . ToFullyQualifiedName ( ) , methodName , propType , isSubScript , isExtension , isStatic ) ;
108
109
}
109
110
110
111
public static string EnumFactoryCaseWrapperName ( SwiftClassName name , string caseName )
@@ -137,7 +138,7 @@ public static string EnumCaseFinderWrapperName (EnumDeclaration en)
137
138
return string . Format ( "{0}{1}ec" , kXamPrefix , classPrefix ) ;
138
139
}
139
140
140
- public static string WrapperName ( string fullyQualifiedClassName , string methodName , PropertyType propType , bool isSubScript , bool isExtension )
141
+ public static string WrapperName ( string fullyQualifiedClassName , string methodName , PropertyType propType , bool isSubScript , bool isExtension , bool isStatic )
141
142
{
142
143
var lastIndex = fullyQualifiedClassName . LastIndexOf ( '.' ) ;
143
144
if ( lastIndex >= 0 ) {
@@ -147,13 +148,13 @@ public static string WrapperName (string fullyQualifiedClassName, string methodN
147
148
char propMarker = isSubScript ? 's' : 'p' ;
148
149
switch ( propType ) {
149
150
case PropertyType . Getter :
150
- propMarker = 'G' ;
151
+ propMarker = isStatic ? 'g' : 'G' ;
151
152
break ;
152
153
case PropertyType . Setter :
153
- propMarker = 'S' ;
154
+ propMarker = isStatic ? 's' : 'S' ;
154
155
break ;
155
156
case PropertyType . Materializer :
156
- propMarker = 'M' ;
157
+ propMarker = isStatic ? 'm' : 'M' ;
157
158
break ;
158
159
default :
159
160
throw ErrorHelper . CreateError ( ReflectorError . kWrappingBase + 0 , $ "unknown property type { propType . ToString ( ) } wrapping function { methodName } in { fullyQualifiedClassName } ") ;
@@ -469,11 +470,11 @@ void WrapProperty (PropertyDeclaration decl, ModuleInventory modInventory, SLFil
469
470
setter . ParameterLists [ 0 ] . Add ( parameter ) ;
470
471
}
471
472
472
- var getWrapperName = WrapperName ( decl . Module . Name , decl . Name , PropertyType . Getter , false , decl . IsExtension ) ;
473
+ var getWrapperName = WrapperName ( decl . Module . Name , decl . Name , PropertyType . Getter , false , decl . IsExtension , decl . IsStatic ) ;
473
474
var getWrapper = MapTopLevelFuncToWrapperFunc ( slfile . Imports , getter , getWrapperName ) ;
474
475
slfile . Functions . Add ( getWrapper ) ;
475
476
if ( setter != null ) {
476
- var setWrapperName = WrapperName ( decl . Module . Name , decl . Name , PropertyType . Setter , false , decl . IsExtension ) ;
477
+ var setWrapperName = WrapperName ( decl . Module . Name , decl . Name , PropertyType . Setter , false , decl . IsExtension , decl . IsStatic ) ;
477
478
var setWrapper = MapTopLevelFuncToWrapperFunc ( slfile . Imports , setter , setWrapperName ) ;
478
479
slfile . Functions . Add ( setWrapper ) ;
479
480
}
@@ -1702,15 +1703,15 @@ SLFunc MapFuncDeclToWrapperFunc (SwiftClassName className, SLImportModules modul
1702
1703
} else if ( funcDecl . IsSubscript ) {
1703
1704
funcName = WrapperName ( className , funcDecl . PropertyName ,
1704
1705
( funcDecl . IsGetter ? PropertyType . Getter :
1705
- ( funcDecl . IsSetter ? PropertyType . Setter : PropertyType . Materializer ) ) , true , funcDecl . IsExtension ) ;
1706
+ ( funcDecl . IsSetter ? PropertyType . Setter : PropertyType . Materializer ) ) , true , funcDecl . IsExtension , funcDecl . IsStatic ) ;
1706
1707
} else if ( funcDecl . IsProperty ) {
1707
1708
funcName = WrapperName ( className , funcDecl . PropertyName ,
1708
1709
( funcDecl . IsGetter ? PropertyType . Getter :
1709
- ( funcDecl . IsSetter ? PropertyType . Setter : PropertyType . Materializer ) ) , false , funcDecl . IsExtension ) ;
1710
+ ( funcDecl . IsSetter ? PropertyType . Setter : PropertyType . Materializer ) ) , false , funcDecl . IsExtension , funcDecl . IsStatic ) ;
1710
1711
} else if ( funcDecl . IsOperator ) {
1711
1712
funcName = WrapperOperatorName ( typeMapper , funcDecl . Parent . ToFullyQualifiedName ( true ) , funcDecl . Name , funcDecl . OperatorType ) ;
1712
1713
} else {
1713
- funcName = WrapperName ( className , funcDecl . Name , funcDecl . IsExtension ) ;
1714
+ funcName = WrapperName ( className , funcDecl . Name , funcDecl . IsExtension , funcDecl . IsStatic ) ;
1714
1715
}
1715
1716
1716
1717
var funcBody = new SLCodeBlock ( preMarshalCode ) ;
0 commit comments