Skip to content

Support Kotlin function types #852

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

Open
ArsenHD opened this issue Sep 3, 2022 · 0 comments
Open

Support Kotlin function types #852

ArsenHD opened this issue Sep 3, 2022 · 0 comments
Assignees
Labels
lang-kotlin Issue is related to Kotlin language support

Comments

@ArsenHD
Copy link
Collaborator

ArsenHD commented Sep 3, 2022

Description

In PR #825 lambdas became allowed as values for fields, method parameters or results if they have a type of some functional interface. However, this was not yet tested on Kotlin function types which also can be represented by lambdas. The goal is to investigate if current support of lambdas is compatible with Kotlin function types. If not, then it should be supported.

See examples of cases where we use lambdas in test class org.utbot.examples.lambda.CustomPredicateExampleTest.

Expected behavior

For functional interfaces we already generate lambdas by finding them somewhere in the available classes. The same should be done for function types. For example, given function type (Int) -> Int, we should be able to find lambdas for it just like we do for functional interface type java.util.function.Function<Integer, Integer>.

Environment

No specific steps to set up the environment are required, just generate tests for Kotlin methods with parameters of function types. It is worth, however, to produce tests in both Java and Kotlin to make sure everything works correctly for both languages.

Potential alternatives

Unknown.

Context

Function types in Kotlin are described here.

@korifey korifey moved this to Todo in UTBot Java Sep 3, 2022
@ArsenHD ArsenHD mentioned this issue Sep 3, 2022
7 tasks
@alisevych alisevych added the lang-kotlin Issue is related to Kotlin language support label Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-kotlin Issue is related to Kotlin language support
Projects
Status: Todo
Development

No branches or pull requests

3 participants