-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#120 Added access level modifiers and other minor related fixes
- Loading branch information
1 parent
ba9f70b
commit 83011df
Showing
32 changed files
with
695 additions
and
192 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
91 changes: 91 additions & 0 deletions
91
.swiftpm/xcode/xcshareddata/xcschemes/SwiftKotlinFramework.xcscheme
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,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1130" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "SwiftKotlinFramework" | ||
BuildableName = "SwiftKotlinFramework" | ||
BlueprintName = "SwiftKotlinFramework" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "NO" | ||
buildForArchiving = "NO" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "SwiftKotlinFrameworkTests" | ||
BuildableName = "SwiftKotlinFrameworkTests" | ||
BlueprintName = "SwiftKotlinFrameworkTests" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "SwiftKotlinFrameworkTests" | ||
BuildableName = "SwiftKotlinFrameworkTests" | ||
BlueprintName = "SwiftKotlinFrameworkTests" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "SwiftKotlinFramework" | ||
BuildableName = "SwiftKotlinFramework" | ||
BlueprintName = "SwiftKotlinFramework" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
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,80 @@ | ||
internal class ImplicitInternalClass { | ||
private val privateVar: Int = 1 | ||
internal val implicitInternalVar: Int = 1 | ||
internal val explicitInternalVar: Int = 1 | ||
|
||
private class PrivateClass { | ||
private var privateVar: Int = 1 | ||
var implicitPrivateVar: Int = 1 | ||
|
||
class InheritedAccess { | ||
private var privateVar: Int = 1 | ||
var implicitPrivateVar: Int = 1 | ||
|
||
fun inheritedAccessFunc() {} | ||
} | ||
|
||
fun inheritedAccessFunc() {} | ||
} | ||
|
||
internal fun implicitInternalFunc() {} | ||
|
||
internal fun internalFunc() {} | ||
|
||
private fun privateFunc() {} | ||
} | ||
|
||
class PublicClass { | ||
private val privateVar: Int = 1 | ||
internal val implicitInternalVar: Int = 1 | ||
internal val explicitInternalVar: Int = 1 | ||
val publicVar: Int = 1 | ||
|
||
internal class InheritedAccess {} | ||
|
||
internal fun implicitInternalFunc() {} | ||
|
||
internal fun internalFunc() {} | ||
|
||
private fun privateFunc() {} | ||
|
||
fun publicFunc() {} | ||
} | ||
|
||
private class PrivateClass { | ||
|
||
class InheritedAccess {} | ||
} | ||
|
||
data class publicStruct( | ||
var publicVar: String, | ||
internal var internalVar: String, | ||
private var privateVar: String) {} | ||
|
||
internal data class internalStruct( | ||
internal var internalVar: String, | ||
private var privateVar: String) {} | ||
|
||
interface publicProtocol {} | ||
enum class publicEnum { | ||
a | ||
} | ||
internal enum class internalEnum { | ||
a | ||
} | ||
|
||
internal fun implicitInternalFunc() { | ||
val internalVariable = 1 | ||
} | ||
|
||
internal fun internalFunc() { | ||
val internalVariable = 1 | ||
} | ||
|
||
private fun privateFunc() { | ||
val internalVariable = 1 | ||
} | ||
|
||
fun publicFunc() { | ||
val internalVariable = 1 | ||
} |
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,80 @@ | ||
|
||
class ImplicitInternalClass { | ||
private let privateVar: Int = 1 | ||
let implicitInternalVar: Int = 1 | ||
internal let explicitInternalVar: Int = 1 | ||
|
||
private class PrivateClass { | ||
private var privateVar: Int = 1 | ||
var implicitPrivateVar: Int = 1 | ||
|
||
class InheritedAccess { | ||
private var privateVar: Int = 1 | ||
var implicitPrivateVar: Int = 1 | ||
|
||
func inheritedAccessFunc() {} | ||
} | ||
|
||
func inheritedAccessFunc() {} | ||
} | ||
|
||
func implicitInternalFunc() {} | ||
internal func internalFunc() {} | ||
private func privateFunc() {} | ||
} | ||
|
||
public class PublicClass { | ||
private let privateVar: Int = 1 | ||
let implicitInternalVar: Int = 1 | ||
internal let explicitInternalVar: Int = 1 | ||
public let publicVar: Int = 1 | ||
|
||
class InheritedAccess { | ||
|
||
} | ||
|
||
func implicitInternalFunc() {} | ||
internal func internalFunc() {} | ||
private func privateFunc() {} | ||
public func publicFunc() {} | ||
} | ||
|
||
private class PrivateClass { | ||
class InheritedAccess { | ||
|
||
} | ||
} | ||
|
||
public struct publicStruct { | ||
public var publicVar: String | ||
var internalVar: String | ||
private var privateVar: String | ||
} | ||
|
||
struct internalStruct { | ||
var internalVar: String | ||
private var privateVar: String | ||
} | ||
|
||
public protocol publicProtocol { | ||
} | ||
|
||
public enum publicEnum { | ||
case a | ||
} | ||
enum internalEnum { | ||
case a | ||
} | ||
|
||
func implicitInternalFunc() { | ||
let internalVariable = 1 | ||
} | ||
internal func internalFunc() { | ||
let internalVariable = 1 | ||
} | ||
private func privateFunc() { | ||
let internalVariable = 1 | ||
} | ||
public func publicFunc() { | ||
let internalVariable = 1 | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
var completionHandlers: List<() -> Unit> = listOf() | ||
internal var completionHandlers: List<() -> Unit> = listOf() | ||
|
||
fun someFunctionWithEscapingClosure(completionHandler: () -> Unit) { | ||
internal fun someFunctionWithEscapingClosure(completionHandler: () -> Unit) { | ||
completionHandlers.append(completionHandler) | ||
} | ||
|
||
fun serve(customerProvider: () -> String) { | ||
internal fun serve(customerProvider: () -> String) { | ||
print("Now serving ${customerProvider()}!") | ||
} | ||
|
||
fun collectCustomerProviders(customerProvider: () -> String) { | ||
internal fun collectCustomerProviders(customerProvider: () -> String) { | ||
customerProviders.append(customerProvider) | ||
} | ||
|
||
fun foo(code: (() -> String)) : String = | ||
internal fun foo(code: (() -> String)) : String = | ||
"foo ${bar(code)}" |
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 |
---|---|---|
@@ -1,26 +1,33 @@ | ||
|
||
open class ClassA { | ||
public constructor() {} | ||
|
||
constructor() {} | ||
} | ||
|
||
open class ClassB: ClassA { | ||
val message: String | ||
val cause: String | ||
public constructor(message: String, cause: String) : super() { | ||
private val cause: String | ||
|
||
constructor(message: String, cause: String) : super() { | ||
this.message = message | ||
this.cause = cause | ||
} | ||
|
||
public constructor(cause: String) : this(message = "", cuase = cause) {} | ||
|
||
constructor(cause: String) : this(message = "", cuase = cause) {} | ||
|
||
private fun privateMethod() {} | ||
|
||
internal fun internalMethod() {} | ||
|
||
fun implicitInternalMethod() | ||
|
||
fun publicMethod() {} | ||
} | ||
|
||
open class ClassC: ClassB { | ||
public constructor() : super(message = "message", cause = "cause") {} | ||
|
||
constructor() : super(message = "message", cause = "cause") {} | ||
} | ||
val obj1 = ClassA() | ||
val obj2 = ClassB(message = "message", cause = "a cause") | ||
val obj3 = ClassB("a cause") | ||
val obj4 = ClassC() | ||
internal val obj1 = ClassA() | ||
internal val obj2 = ClassB(message = "message", cause = "a cause") | ||
internal val obj3 = ClassB("a cause") | ||
internal val obj4 = ClassC() |
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
Oops, something went wrong.