1414
1515import Foundation
1616import JavaTypes
17- import SwiftSyntax
1817import OrderedCollections
18+ import SwiftSyntax
1919
2020/// Any imported (Swift) declaration
2121protocol ImportedDecl {
@@ -36,7 +36,10 @@ public struct ImportedNominalType: ImportedDecl {
3636 public var methods : [ ImportedFunc ] = [ ]
3737 public var variables : [ ImportedVariable ] = [ ]
3838
39- public init ( swiftTypeName: String , javaType: JavaType , swiftMangledName: String ? = nil , kind: NominalTypeKind ) {
39+ public init (
40+ swiftTypeName: String , javaType: JavaType , swiftMangledName: String ? = nil ,
41+ kind: NominalTypeKind
42+ ) {
4043 self . swiftTypeName = swiftTypeName
4144 self . javaType = javaType
4245 self . swiftMangledName = swiftMangledName
@@ -56,7 +59,7 @@ public struct ImportedNominalType: ImportedDecl {
5659 /// The Java class name without the package.
5760 public var javaClassName : String {
5861 switch javaType {
59- case . class( package : _, name : let name) : name
62+ case . class( package : _, let name) : name
6063 default : javaType. description
6164 }
6265 }
@@ -250,7 +253,7 @@ public struct ImportedVariable: ImportedDecl, CustomStringConvertible {
250253 public var identifier : String
251254
252255 /// Which accessors are we able to expose.
253- ///
256+ ///
254257 /// Usually this will be all the accessors the variable declares,
255258 /// however if the getter is async or throwing we may not be able to import it
256259 /// (yet), and therefore would skip it from the supported set.
@@ -285,13 +288,14 @@ public struct ImportedVariable: ImportedDecl, CustomStringConvertible {
285288
286289 switch kind {
287290 case . set:
288- let newValueParam : FunctionParameterSyntax = " _ newValue: \( self . returnType. cCompatibleSwiftType) "
291+ let newValueParam : FunctionParameterSyntax =
292+ " _ newValue: \( self . returnType. cCompatibleSwiftType) "
289293 var funcDecl = ImportedFunc (
290294 parentName: self . parentName,
291295 identifier: self . identifier,
292296 returnType: TranslatedType . void,
293297 parameters: [ . init( param: newValueParam, type: self . returnType) ] )
294- funcDecl. swiftMangledName = self . swiftMangledName + " s " // form mangled name of the getter by adding the suffix
298+ funcDecl. swiftMangledName = self . swiftMangledName + " s " // form mangled name of the getter by adding the suffix
295299 return funcDecl
296300
297301 case . get:
@@ -300,21 +304,24 @@ public struct ImportedVariable: ImportedDecl, CustomStringConvertible {
300304 identifier: self . identifier,
301305 returnType: self . returnType,
302306 parameters: [ ] )
303- funcDecl. swiftMangledName = self . swiftMangledName + " g " // form mangled name of the getter by adding the suffix
307+ funcDecl. swiftMangledName = self . swiftMangledName + " g " // form mangled name of the getter by adding the suffix
304308 return funcDecl
305309 }
306310 }
307311
308- public func effectiveAccessorParameters( _ kind: VariableAccessorKind , selfVariant: SelfParameterVariant ? ) -> [ ImportedParam ] {
312+ public func effectiveAccessorParameters(
313+ _ kind: VariableAccessorKind , selfVariant: SelfParameterVariant ?
314+ ) -> [ ImportedParam ] {
309315 var params : [ ImportedParam ] = [ ]
310316
311317 if kind == . set {
312- let newValueParam : FunctionParameterSyntax = " _ newValue: \( raw: self . returnType. swiftTypeName) "
318+ let newValueParam : FunctionParameterSyntax =
319+ " _ newValue: \( raw: self . returnType. swiftTypeName) "
313320 params. append (
314321 ImportedParam (
315322 param: newValueParam,
316323 type: self . returnType)
317- )
324+ )
318325 }
319326
320327 if let parentName {
0 commit comments