Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate interface from class extending other generated interfaces #39

Closed
micHar opened this issue Sep 6, 2021 · 1 comment
Closed

Comments

@micHar
Copy link
Contributor

micHar commented Sep 6, 2021

Consider this structure:

@ToNativeInterface
interface Interface1 {
    suspend fun one() : Float
}

@ToNativeInterface
interface Interface2 {
    suspend fun two() : Float
}

@ToNativeClass
@ToNativeInterface
class MultiClass : Interface1, Interface2 {
    override suspend fun one() = TODO()
    override suspend fun two() = TODO()
    suspend fun three() : Float = TODO()
}

Right now this will fail, because the generated MultiClassNativeProtocol will not depend on generated Interface1NativeProtocol and Interface2NativeProtocol.

To fix this we need to generate interfaces in order of inheritance (and to do that we need to resolve the topological order of the inheritance DAG) and then modify interface generation to take superinterfaces into account as well.

micHar added a commit that referenced this issue Nov 12, 2021
micHar added a commit that referenced this issue Nov 12, 2021
…-ios-suspendwrapper into fix/#39-multi-inheritance
micHar added a commit that referenced this issue Nov 12, 2021
# Conflicts:
#	koru-processor/src/jvmMain/kotlin/com/futuremind/koru/processor/Processor.kt
micHar added a commit that referenced this issue Nov 12, 2021
micHar added a commit that referenced this issue Nov 12, 2021
micHar added a commit that referenced this issue Nov 12, 2021
Works out inheritance hierarchy and generates interfaces in the correct order to properly work out how the generated interfaces should override each other.
@micHar
Copy link
Contributor Author

micHar commented Nov 12, 2021

Closed via #44

@micHar micHar closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant