Make embedKernel arguments nullable #132
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theresolutionInfoProvider
nullable again, which also means that existing code using the method and passing null, still works with the the signature usingResolutionInfoProvider
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
passesedit 2: I now know about
.INSTANCE
, so I can just useresolutionInfoProvider.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 callembedKernel
from an existing Java application without being familiar with the nuances of embedding Kotlin code into a Java project.