[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:
Dmitriy Novozhilov
2020-07-02 14:52:56 +03:00
parent 44d0af8597
commit a882a9dff5
5 changed files with 47 additions and 9 deletions
@@ -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()
}
@@ -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|()
}