-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nested types inside type with keyword name 2.
- Loading branch information
1 parent
44fbf29
commit 925eca0
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
Submodule acceptance-tests
updated
from bc78e3 to 1fe704
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...co/touchlab/skie/phases/typeconflicts/RenameSkieNamespacesConflictingWithKeywordsPhase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 += "_" | ||
} | ||
} | ||
} |