-
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.
Implement InternalIfWrapped visibility.
- Loading branch information
1 parent
36810d7
commit e7e8195
Showing
15 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
Submodule acceptance-tests
updated
from 89af84 to d4a94e
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
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
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
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
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
24 changes: 24 additions & 0 deletions
24
.../skie/phases/sir/member/ConfigureInternalVisibilityForWrappedCallableDeclarationsPhase.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,24 @@ | ||
package co.touchlab.skie.phases.sir.member | ||
|
||
import co.touchlab.skie.configuration.SkieVisibility | ||
import co.touchlab.skie.phases.SirPhase | ||
import co.touchlab.skie.sir.element.SirCallableDeclaration | ||
import co.touchlab.skie.sir.element.SirVisibility | ||
import co.touchlab.skie.sir.element.isAbstract | ||
|
||
object ConfigureInternalVisibilityForWrappedCallableDeclarationsPhase : SirPhase { | ||
|
||
context(SirPhase.Context) | ||
override suspend fun execute() { | ||
sirProvider.allLocalCallableDeclarations | ||
.filter { it.isWrappedBySkie && it.shouldBeInternalIfWrappedBySkie && it.visibility == SirVisibility.Public && !it.isAbstract } | ||
.forEach { | ||
it.visibility = SirVisibility.Internal | ||
} | ||
} | ||
|
||
context(SirPhase.Context) | ||
private val SirCallableDeclaration.shouldBeInternalIfWrappedBySkie: Boolean | ||
// TODO Once SirCallableDeclaration origin is added check even for intermediate wrappers and configure those based on the Kir configuration as well. | ||
get() = kirProvider.findCallableDeclaration<SirCallableDeclaration>(this)?.configuration?.get(SkieVisibility) == SkieVisibility.Level.InternalIfWrapped | ||
} |
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
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
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
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
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
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
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
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