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

Type information lost on Kotlin DSL accessors to typed Kotlin lambda extensions #10772

Closed
eskatos opened this issue Sep 18, 2019 · 0 comments · Fixed by #10800
Closed

Type information lost on Kotlin DSL accessors to typed Kotlin lambda extensions #10772

eskatos opened this issue Sep 18, 2019 · 0 comments · Fixed by #10800
Assignees
Milestone

Comments

@eskatos
Copy link
Member

eskatos commented Sep 18, 2019

Given a plugin that registers a Kotlin lambda with a TypeOf type token:

val typeToken = typeOf<(String) -> String>()
val lambda = { name: String ->  name.toUpperCase() }
extensions.add(typeToken, "lambdaExtension", lambda)

Expected Behavior

The Kotlin DSL accessor for lambdaExtension should be typed Function1<String, String>.

Current Behavior

The Kotlin DSL accessor for lambdaExtension is typed Function1<Object, String>.

Context

Bug report that triggered the investigation: #10729
PR for the above bug that also introduces a test for this issue #10758

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants