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

Getting incompatible return type error when extending FungibleToken in Java #213

Open
LHao87 opened this issue Sep 16, 2020 · 0 comments
Open

Comments

@LHao87
Copy link

LHao87 commented Sep 16, 2020

There is a question asked long time ago:
https://stackoverflow.com/questions/57650475/error-when-extending-fungibletoken-supportedschemas-in-queryablestate-clashes

As shown in the question, when extending FungibleToken, it will get the error of incompatible return type. This only happens when writing in Java. Kotlin works just fine.
This could be because the supportedSchemas() in the FungibleToken does not specify its return type.

That's to say, if we change the supportedSchemas() method in the FungibleToken from
override fun supportedSchemas() = listOf(FungibleTokenSchemaV1)
to
override fun supportedSchemas() : Iterable<MappedSchema> = listOf(FungibleTokenSchemaV1)
Then the error will disappear.

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