Specify type explicitly: do not consider star projection arguments in KotlinType.isFlexibleRecursive() #KT-13055 Fixed
(cherry picked from commit 828f4bf)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
51ccfc120e
commit
b675b49daf
@@ -51,7 +51,7 @@ class SpecifyTypeExplicitlyIntention :
|
||||
|
||||
private fun KotlinType.isFlexibleRecursive(): Boolean {
|
||||
if (isFlexible()) return true
|
||||
return arguments.any { it.type.isFlexibleRecursive() }
|
||||
return arguments.any { !it.isStarProjection && it.type.isFlexibleRecursive() }
|
||||
}
|
||||
|
||||
fun dangerousFlexibleTypeOrNull(declaration: KtCallableDeclaration, publicAPIOnly: Boolean): KotlinType? {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// KT-13055: SOE in isFlexibleRecursive
|
||||
interface Rec<R, out T: Rec<R, T>> {
|
||||
fun t(): T
|
||||
}
|
||||
interface Super {
|
||||
fun foo(p: Rec<*, *>) = p.t()
|
||||
}
|
||||
Reference in New Issue
Block a user