Skip to content

Commit

Permalink
Fix nested types inside type with keyword name 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDolnik committed Sep 25, 2023
1 parent 44fbf29 commit 925eca0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SKIE/acceptance-tests
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ import co.touchlab.skie.phases.swift.CompileSwiftPhase
import co.touchlab.skie.phases.swift.GenerateSirFileCodePhase
import co.touchlab.skie.phases.swift.SwiftCacheSetupPhase
import co.touchlab.skie.phases.swift.WriteSirFileContentToDiskPhase
import co.touchlab.skie.phases.typeconflicts.RenameNestedTypesConflictingWithExternalTypesPhase
import co.touchlab.skie.phases.typeconflicts.RenameNestedKotlinTypesConflictingWithKeywordsPhase
import co.touchlab.skie.phases.typeconflicts.RenameNestedTypesConflictingWithExternalTypesPhase
import co.touchlab.skie.phases.typeconflicts.RenameSkieNamespacesConflictingWithKeywordsPhase
import co.touchlab.skie.phases.typeconflicts.RenameTypesConflictingWithKotlinModulePhase
import co.touchlab.skie.phases.typeconflicts.RenameTypesConflictsWithOtherTypesPhase
import co.touchlab.skie.phases.typeconflicts.TemporarilyRenameTypesConflictingWithExternalModulesPhase
Expand Down Expand Up @@ -81,6 +82,7 @@ class SkiePhaseScheduler {
RemoveKonanManglingPhase,
RenameNestedTypesConflictingWithExternalTypesPhase,
RenameNestedKotlinTypesConflictingWithKeywordsPhase,
RenameSkieNamespacesConflictingWithKeywordsPhase,
RenameTypesConflictingWithKotlinModulePhase,
KotlinRuntimeHidingPhase,

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package co.touchlab.skie.phases.typeconflicts

import co.touchlab.skie.phases.SirPhase
import io.outfoxx.swiftpoet.KEYWORDS

object RenameSkieNamespacesConflictingWithKeywordsPhase : SirPhase {

context(SirPhase.Context)
override fun execute() {
swiftModelProvider.exposedTypes
.map { sirProvider.getSkieNamespace(it) }
.filter { it.simpleName in KEYWORDS }
.forEach {
it.simpleName += "_"
}
}
}

0 comments on commit 925eca0

Please sign in to comment.