Kotlin: Add a test of recursive instantiations

This used to cause a stack overflow
This commit is contained in:
Ian Lynagh
2022-03-08 15:09:09 +00:00
parent 90f7cc1223
commit 0d79dfc412
5 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
public interface BaseFoo<T, S extends BaseFoo<T, S>> {}

View File

@@ -0,0 +1,3 @@
public interface Foo<T> extends BaseFoo<T, Foo<T>> {}

View File

@@ -0,0 +1,3 @@
| test.kt:2:1:11:1 | MyClass |
| test.kt:4:13:9:13 | |
| test.kt:5:17:6:17 | SomeClass |

View File

@@ -0,0 +1,5 @@
import java
from Class c
where c.fromSource()
select c

View File

@@ -0,0 +1,11 @@
class MyClass() {
fun f1() {
fun f2() {
class SomeClass {
}
val x: Foo<SomeClass>? = null
}
}
}