@@ -85,15 +85,16 @@ public static string WrapperOperatorName (TypeMapper typeMapper, string moduleNa
8585 return $ "{ kXamPrefix } { classPrefix } { operatorType } { operatorName } ";
8686 }
8787
88- public static string WrapperName ( SwiftClassName name , string methodName , bool isExtension )
88+ public static string WrapperName ( SwiftClassName name , string methodName , bool isExtension , bool isStatic )
8989 {
90- return WrapperName ( name . ToFullyQualifiedName ( false ) , methodName , isExtension ) ;
90+ return WrapperName ( name . ToFullyQualifiedName ( false ) , methodName , isExtension , isStatic ) ;
9191 }
9292
93- public static string WrapperName ( string fullyQualifiedClassName , string methodName , bool isExtension )
93+ public static string WrapperName ( string fullyQualifiedClassName , string methodName , bool isExtension , bool isStatic )
9494 {
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 } ";
9798 }
9899
99100 public static string WrapperCtorName ( SwiftClassName name , bool isExtension )
@@ -102,9 +103,9 @@ public static string WrapperCtorName (SwiftClassName name, bool isExtension)
102103 return $ "{ kXamPrefix } { classPrefix } { ( isExtension ? 'E' : 'D' ) } { name . Terminus } ";
103104 }
104105
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 )
106107 {
107- return WrapperName ( name . ToFullyQualifiedName ( ) , methodName , propType , isSubScript , isExtension ) ;
108+ return WrapperName ( name . ToFullyQualifiedName ( ) , methodName , propType , isSubScript , isExtension , isStatic ) ;
108109 }
109110
110111 public static string EnumFactoryCaseWrapperName ( SwiftClassName name , string caseName )
@@ -137,7 +138,7 @@ public static string EnumCaseFinderWrapperName (EnumDeclaration en)
137138 return string . Format ( "{0}{1}ec" , kXamPrefix , classPrefix ) ;
138139 }
139140
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 )
141142 {
142143 var lastIndex = fullyQualifiedClassName . LastIndexOf ( '.' ) ;
143144 if ( lastIndex >= 0 ) {
@@ -147,13 +148,13 @@ public static string WrapperName (string fullyQualifiedClassName, string methodN
147148 char propMarker = isSubScript ? 's' : 'p' ;
148149 switch ( propType ) {
149150 case PropertyType . Getter :
150- propMarker = 'G' ;
151+ propMarker = isStatic ? 'g' : 'G' ;
151152 break ;
152153 case PropertyType . Setter :
153- propMarker = 'S' ;
154+ propMarker = isStatic ? 's' : 'S' ;
154155 break ;
155156 case PropertyType . Materializer :
156- propMarker = 'M' ;
157+ propMarker = isStatic ? 'm' : 'M' ;
157158 break ;
158159 default :
159160 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
469470 setter . ParameterLists [ 0 ] . Add ( parameter ) ;
470471 }
471472
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 ) ;
473474 var getWrapper = MapTopLevelFuncToWrapperFunc ( slfile . Imports , getter , getWrapperName ) ;
474475 slfile . Functions . Add ( getWrapper ) ;
475476 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 ) ;
477478 var setWrapper = MapTopLevelFuncToWrapperFunc ( slfile . Imports , setter , setWrapperName ) ;
478479 slfile . Functions . Add ( setWrapper ) ;
479480 }
@@ -1702,15 +1703,15 @@ SLFunc MapFuncDeclToWrapperFunc (SwiftClassName className, SLImportModules modul
17021703 } else if ( funcDecl . IsSubscript ) {
17031704 funcName = WrapperName ( className , funcDecl . PropertyName ,
17041705 ( 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 ) ;
17061707 } else if ( funcDecl . IsProperty ) {
17071708 funcName = WrapperName ( className , funcDecl . PropertyName ,
17081709 ( 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 ) ;
17101711 } else if ( funcDecl . IsOperator ) {
17111712 funcName = WrapperOperatorName ( typeMapper , funcDecl . Parent . ToFullyQualifiedName ( true ) , funcDecl . Name , funcDecl . OperatorType ) ;
17121713 } else {
1713- funcName = WrapperName ( className , funcDecl . Name , funcDecl . IsExtension ) ;
1714+ funcName = WrapperName ( className , funcDecl . Name , funcDecl . IsExtension , funcDecl . IsStatic ) ;
17141715 }
17151716
17161717 var funcBody = new SLCodeBlock ( preMarshalCode ) ;
0 commit comments