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

use in Java - error: reference to getMetadata is ambiguous #5

Open
paulvi opened this issue Sep 10, 2021 · 1 comment
Open

use in Java - error: reference to getMetadata is ambiguous #5

paulvi opened this issue Sep 10, 2021 · 1 comment

Comments

@paulvi
Copy link

paulvi commented Sep 10, 2021

public static void main(String[] args) {
        String rpcUrl = "wss://127.0.0.1:9944";
        var provider = new SubstrateProvider(rpcUrl);
        var meta = provider.getMetadata().blockingGet();

}

build and get error

 % gradle build

> Task :compileJava FAILED
bcd-java/src/main/java/UsingSubstrateClientKotlin.java:10: error: reference to getMetadata is ambiguous
        var meta = provider.getMetadata().blockingGet();
                           ^
  both method getMetadata() in SubstrateProvider and method getMetadata() in SubstrateProvider match
bcd-java/src/main/java/UsingSubstrateClientKotlin.java:10: error: cannot find symbol
        var meta = provider.getMetadata().blockingGet();
                                         ^
  symbol:   method blockingGet()
  location: class RuntimeMetadata
2 errors

FAILURE: Build failed with an exception.

For sure this should be "call Kotlin from Java" issue, however I have no clue how to solve

@paulvi
Copy link
Author

paulvi commented Sep 10, 2021

I guess related docs are https://kotlinlang.org/spec/overload-resolution.html

But I have not found any generation recommendation for dealing with in Java.

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