Skip to content

Commit 1d2219e

Browse files
committed
Make i13044 more resilient
This tests that we handle stack overflows correctly. Due to some general improvements we are closer to not reaching the stack overflow. Therefore, we make this tests unroll a few more inlines to make sure that this stack overflow is reached.
1 parent 36a9940 commit 1d2219e

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

tests/neg/i13044.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-- Error: tests/neg/i13044.scala:50:40 ---------------------------------------------------------------------------------
2-
50 | implicit def typeSchema: Schema[A] = Schema.gen // error // error
1+
-- Error: tests/neg/i13044.scala:65:40 ---------------------------------------------------------------------------------
2+
65 | implicit def typeSchema: Schema[A] = Schema.gen // error // error
33
| ^^^^^^^^^^
44
| given instance gen is declared as `inline`, but was not inlined
55
|
@@ -71,8 +71,8 @@
7171
37 | inline given gen[A]: Schema[A] = derived
7272
| ^^^^^^^
7373
--------------------------------------------------------------------------------------------------------------------
74-
-- Error: tests/neg/i13044.scala:50:40 ---------------------------------------------------------------------------------
75-
50 | implicit def typeSchema: Schema[A] = Schema.gen // error // error
74+
-- Error: tests/neg/i13044.scala:65:40 ---------------------------------------------------------------------------------
75+
65 | implicit def typeSchema: Schema[A] = Schema.gen // error // error
7676
| ^^^^^^^^^^
7777
| method recurse is declared as `inline`, but was not inlined
7878
|

tests/neg/i13044.scala

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,22 @@ trait SchemaDerivation {
3737
inline given gen[A]: Schema[A] = derived
3838
}
3939

40-
case class H(i: Int)
40+
case class X15(i: Int)
41+
case class X14(i: X15)
42+
case class X13(i: X14)
43+
case class X12(i: X13)
44+
case class X11(i: X12)
45+
case class X10(i: X11)
46+
case class X9(i: X10)
47+
case class X8(i: X9)
48+
case class X7(i: X8)
49+
case class X6(i: X7)
50+
case class X5(i: X6)
51+
case class X4(i: X5)
52+
case class X3(i: X4)
53+
case class X2(i: X3)
54+
case class X1(i: X2)
55+
case class H(i: X1)
4156
case class G(h: H)
4257
case class F(g: G)
4358
case class E(f: Option[F])

0 commit comments

Comments
 (0)