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

Second overload of IsNotNull crashes the kotlin compiler #260

Open
MartinHaeusler opened this issue Feb 14, 2022 · 1 comment
Open

Second overload of IsNotNull crashes the kotlin compiler #260

MartinHaeusler opened this issue Feb 14, 2022 · 1 comment

Comments

@MartinHaeusler
Copy link

I've just tried upgrading from strikt 0.33 to strikt 0.34. It's a kotlin-JVM project with Kotlin 1.6.10.

In strikt 0.34, a second overload of the IsNotNull method was introduced:

/**
 * noop not null assertion on not nullable receiver
 */
@JvmName("isNotNullT?")
fun <T : Any> Builder<T>.isNotNull(): Builder<T> = this

The existence of this overload causes issues for the kotlin compiler. Code which worked fine on strikt 0.33 doesn't compile with 0.34 anymore because of this overload (Kotlin: [Internal Error] org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at ...)

@MartinHaeusler
Copy link
Author

In theory it should be possible to define a single isNotNull method that works on both nullable and non-nullable types, right? Or is the generic typebound on Builder<T> getting in the way?

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