Reputation: 1
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
Upvotes: 0
Views: 140
Reputation: 3455
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's apply
. 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 of apply { }
ImmutablePair
that cannot be achieve with Kotlin's native Pair
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.
Upvotes: 1