Don't look at raw type's arguments while enhancing super types

^KT-48172 Fixed
This commit is contained in:
Victor Petukhov
2021-08-17 18:41:34 +03:00
committed by TeamCityServer
parent 63cefe228d
commit d730db094a
14 changed files with 188 additions and 33 deletions
@@ -0,0 +1,2 @@
class Bar<K> {
}
@@ -0,0 +1,27 @@
// WITH_RUNTIME
// TARGET_BACKEND: JVM
/*
ServletOpenApiContextBuilder<
T : raw (
ServletOpenApiContextBuilder<ServletOpenApiContextBuilder<*>>
..
ServletOpenApiContextBuilder<out ServletOpenApiContextBuilder<*>>?
)
>
: GenericOpenApiContextBuilder<
raw (
ServletOpenApiContextBuilder<[ERROR : <LOOP IN SUPERTYPES>]> // exception on this error type during serialization
..
ServletOpenApiContextBuilder<*>?
)
>
*/
public class Foo<T extends Foo> extends Bar<Foo> {
String ctxId = "";
public T ctxId(String ctxId) {
this.ctxId = ctxId;
return (T) this;
}
}
@@ -0,0 +1,11 @@
// WITH_RUNTIME
// TARGET_BACKEND: JVM
public class Foo<T extends Foo> extends Bar<Foo> {
String ctxId = "";
public T ctxId(String ctxId) {
this.ctxId = ctxId;
return (T) this;
}
}
@@ -0,0 +1,6 @@
================ Step #1 =================
Compiling files:
End of files
Exit code: OK
@@ -0,0 +1,7 @@
================ Step #1 =================
Compiling files:
src/main.kt
End of files
Exit code: OK
@@ -0,0 +1,7 @@
class Main {
fun init() {
Foo<Foo<*>>() //this is the call that causes the build exception, if you comment it out everything works fine
.ctxId("")
}
}
fun box() = "OK"