[FIR] Create scope for type parameter as scope for intersection of bounds
Before change we've created composite scope for all bounds, which is incorrect, because intersection of all bounds may be less than all bounds (see test in commit) #KT-39032 Fixed
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// ISSUE: KT-39032
|
||||
|
||||
interface A {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
interface B : A {
|
||||
override fun foo()
|
||||
}
|
||||
|
||||
fun <E> bar(e: E) where E : A, E : B {
|
||||
e.foo()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
FILE: uselessMultipleBounds.kt
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract interface B : R|A| {
|
||||
public abstract override fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final fun <E : R|A|, R|B|> bar(e: R|E|): R|kotlin/Unit| {
|
||||
R|<local>/e|.R|/B.foo|()
|
||||
}
|
||||
Reference in New Issue
Block a user