Skip to content

Commit 19b5504

Browse files
authored
Merge pull request #514 from swiftwasm/yt/remove-exportedProtocolNameByKey
BridgeJS: Remove adhoc `exportedProtocolNameByKey` recording
2 parents 1f3ba60 + 222b12c commit 19b5504

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class ExportSwift {
2626
private var exportedEnums: [ExportedEnum] = []
2727
private var exportedStructs: [ExportedStruct] = []
2828
private var exportedProtocols: [ExportedProtocol] = []
29-
private var exportedProtocolNameByKey: [String: String] = [:]
3029
private var typeDeclResolver: TypeDeclResolver = TypeDeclResolver()
3130
private var sourceFiles: [(sourceFile: SourceFileSyntax, inputFilePath: String)] = []
3231

@@ -1136,8 +1135,6 @@ public class ExportSwift {
11361135

11371136
stateStack.pop()
11381137

1139-
parent.exportedProtocolNameByKey[protocolUniqueKey] = name
1140-
11411138
return .skipChildren
11421139
}
11431140

@@ -1598,11 +1595,6 @@ public class ExportSwift {
15981595
return primitiveType
15991596
}
16001597

1601-
let protocolKey = typeName
1602-
if let protocolName = exportedProtocolNameByKey[protocolKey] {
1603-
return .swiftProtocol(protocolName)
1604-
}
1605-
16061598
guard let typeDecl = typeDeclResolver.resolve(type) else {
16071599
return nil
16081600
}

Plugins/BridgeJS/Sources/BridgeJSCore/TypeDeclResolver.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ class TypeDeclResolver {
6363
override func visitPost(_ node: EnumDeclSyntax) {
6464
visitPostNominalDecl()
6565
}
66+
override func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind {
67+
return visitNominalDecl(node)
68+
}
69+
override func visitPost(_ node: ProtocolDeclSyntax) {
70+
visitPostNominalDecl()
71+
}
6672

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

0 commit comments

Comments
 (0)