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

Make embedKernel arguments nullable #132

Merged
merged 1 commit into from
Mar 2, 2021
Merged

Conversation

fmagin
Copy link
Contributor

@fmagin fmagin commented Mar 2, 2021

EmptyResolutionInfoProvider is created by an object declaration which fails to import in pure java code. The embedKernel method is intended to be called inside pure Java code that simply has the compiled kotlin kernel jars available as a dependency, but the former signature after the refactor in 782f088#diff-3c1c4b1ddbb3338fe28601f266bb3c492ac38a395dafb1c3ad4b60a8ffeedc62R85 makes this impossible. This commit makes the resolutionInfoProvider nullable again, which also means that existing code using the method and passing null, still works with the the signature using ResolutionInfoProvider

edit 1: I can't see the build details, so I can't debug why this fails, it builds for me locally and ./gradlew check passes

edit 2: I now know about .INSTANCE, so I can just use resolutionInfoProvider.INSTANCE instead and it works without requiring this PR. I would argue that allowing a signature that violates the typical Kotlin style in this specific case is still reasonable to make it as easy as possible for Java projects and devs to just call embedKernel from an existing Java application without being familiar with the nuances of embedding Kotlin code into a Java project.

EmptyResolutionInfoProvider is created by an [object declaration](https://kotlinlang.org/docs/object-declarations.html#object-declarations) which fails to import in pure java code. The `embedKernel` method is intended to be called inside pure Java code that simply has the compiled kotlin kernel jars available as a dependency, but the former signature after the refactor in Kotlin@782f088#diff-3c1c4b1ddbb3338fe28601f266bb3c492ac38a395dafb1c3ad4b60a8ffeedc62R85 makes this impossible. This commit makes the `resolutionInfoProvider` nullable again, which also means that existing code using the method and passing null, still works with the the signature using `ResolutionInfoProvider`
@ileasile ileasile merged commit 5917955 into Kotlin:master Mar 2, 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

Successfully merging this pull request may close these issues.

2 participants