[AA] approximate inplace type parameters bounds
^ KTIJ-27211 fixed
This commit is contained in:
+7
@@ -18,5 +18,12 @@ public object KtDeclarationRendererForDebug {
|
||||
typeRenderer = KtTypeRendererForDebug.WITH_QUALIFIED_NAMES
|
||||
declarationTypeApproximator = KtRendererTypeApproximator.NO_APPROXIMATION
|
||||
}
|
||||
|
||||
public val WITH_QUALIFIED_NAMES_DENOTABLE: KtDeclarationRenderer = KtDeclarationRendererForSource.WITH_QUALIFIED_NAMES.with {
|
||||
singleTypeParameterRenderer = KtSingleTypeParameterSymbolRenderer.WITHOUT_BOUNDS
|
||||
samConstructorRenderer = KtSamConstructorSymbolRenderer.AS_FUNCTION
|
||||
typeRenderer = KtTypeRendererForDebug.WITH_QUALIFIED_NAMES
|
||||
declarationTypeApproximator = KtRendererTypeApproximator.TO_DENOTABLE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -63,7 +63,9 @@ public interface KtTypeParametersRenderer {
|
||||
)
|
||||
if (typeParameter.upperBounds.size == 1) {
|
||||
append(" : ")
|
||||
typeRenderer.renderType(typeParameter.upperBounds.single(), printer)
|
||||
val ktType = typeParameter.upperBounds.single()
|
||||
val type = declarationTypeApproximator.approximateType(ktType, Variance.OUT_VARIANCE)
|
||||
typeRenderer.renderType(type, printer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
open fun <K> foo() where K : T?, K : java.lang.Runnable?
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// DO_NOT_CHECK_SYMBOL_RESTORE_K1
|
||||
|
||||
// FILE: main.kt
|
||||
class J: JavaClass<String> {}
|
||||
|
||||
fun some(j: J) {
|
||||
j.f<caret>o<caret_onAirContext>o()
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass<T> {
|
||||
public <K extends T & Runnable> void foo() {};
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
open fun <K> foo() where K : kotlin.String?, K : java.lang.Runnable?
|
||||
+1
@@ -0,0 +1 @@
|
||||
open fun <K : T?> foo()
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
//DO_NOT_CHECK_SYMBOL_RESTORE_K1
|
||||
|
||||
// FILE: main.kt
|
||||
class J: JavaClass<String> {}
|
||||
|
||||
fun some(j: J) {
|
||||
j.f<caret>o<caret_onAirContext>o()
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass<T> {
|
||||
public <K extends T> void foo() {};
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
open fun <K : kotlin.String?> foo()
|
||||
Reference in New Issue
Block a user