Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class ExportSwift {
private var exportedEnums: [ExportedEnum] = []
private var exportedStructs: [ExportedStruct] = []
private var exportedProtocols: [ExportedProtocol] = []
private var exportedProtocolNameByKey: [String: String] = [:]
private var typeDeclResolver: TypeDeclResolver = TypeDeclResolver()
private var sourceFiles: [(sourceFile: SourceFileSyntax, inputFilePath: String)] = []

Expand Down Expand Up @@ -1136,8 +1135,6 @@ public class ExportSwift {

stateStack.pop()

parent.exportedProtocolNameByKey[protocolUniqueKey] = name

return .skipChildren
}

Expand Down Expand Up @@ -1598,11 +1595,6 @@ public class ExportSwift {
return primitiveType
}

let protocolKey = typeName
if let protocolName = exportedProtocolNameByKey[protocolKey] {
return .swiftProtocol(protocolName)
}

guard let typeDecl = typeDeclResolver.resolve(type) else {
return nil
}
Expand Down
6 changes: 6 additions & 0 deletions Plugins/BridgeJS/Sources/BridgeJSCore/TypeDeclResolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ class TypeDeclResolver {
override func visitPost(_ node: EnumDeclSyntax) {
visitPostNominalDecl()
}
override func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind {
return visitNominalDecl(node)
}
override func visitPost(_ node: ProtocolDeclSyntax) {
visitPostNominalDecl()
}

override func visit(_ node: TypeAliasDeclSyntax) -> SyntaxVisitorContinueKind {
let name = node.name.text
Expand Down