I am facing an issue with my code since upgrading the lang3 version from 2.12.0 to 2.12.13
ImmutablePair(it, action).apply { className.invoke(this) }
It was working fine before but after the update, it states
"Not enough information to infer type variable T".
Is there any reason for this?
I turned it back to the old version since it broke the code
apply
was introduced in v3.13.0 to "Applies this key and value as arguments to the given function."apply()
method you cannot use Kotlin'sapply
. So the behaviour you see is not a Kotlin defect, but you are unwittingly using a totally different method from Apache Commons.run { }
,let { }
, etc instead ofapply { }
ImmutablePair
that cannot be achieve with Kotlin's nativePair
class (which is immutable)? Consider changing to that!You do not state what the object
className
is. Perhaps there is something else relevant with that.