Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d79dfc

Browse files
committed
Kotlin: Add a test of recursive instantiations
This used to cause a stack overflow
1 parent 90f7cc1 commit 0d79dfc

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
public interface BaseFoo<T, S extends BaseFoo<T, S>> {}
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
public interface Foo<T> extends BaseFoo<T, Foo<T>> {}
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| test.kt:2:1:11:1 | MyClass |
2+
| test.kt:4:13:9:13 | |
3+
| test.kt:5:17:6:17 | SomeClass |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import java
2+
3+
from Class c
4+
where c.fromSource()
5+
select c
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
class MyClass() {
3+
fun f1() {
4+
fun f2() {
5+
class SomeClass {
6+
}
7+
8+
val x: Foo<SomeClass>? = null
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)