Skip to content

Commit 5a6580c

Browse files
committed
Strip unnecessary stack trace from a test
1 parent c004c13 commit 5a6580c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/neg-macros/i23008.check

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
| ^^^^^^^^^^^^^^^^^^
44
| Exception occurred while executing macro expansion.
55
| java.lang.IllegalArgumentException: requirement failed: value of StringConstant cannot be `null`
6-
| at scala.Predef$.require(Predef.scala:394)
7-
| at scala.quoted.runtime.impl.QuotesImpl$reflect$StringConstant$.apply(QuotesImpl.scala:2542)
8-
| at scala.quoted.runtime.impl.QuotesImpl$reflect$StringConstant$.apply(QuotesImpl.scala:2541)
9-
| at scala.quoted.ToExpr$StringToExpr.apply(ToExpr.scala:82)
10-
| at scala.quoted.ToExpr$StringToExpr.apply(ToExpr.scala:80)
11-
| at scala.quoted.Expr$.apply(Expr.scala:72)
12-
| at Macros$.buildStringCode(Macro_1.scala:9)
136
|
147
|---------------------------------------------------------------------------------------------------------------------
158
|Inline stack trace

tests/neg-macros/i23008/Macro_1.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ object Macros {
66
def buildStringCode(using Quotes): Expr[String] = {
77
import quotes.reflect.*
88
val str: String = null
9-
Expr(str)
9+
try
10+
Expr(str)
11+
catch
12+
case error: java.lang.IllegalArgumentException =>
13+
error.setStackTrace(Array[StackTraceElement]())
14+
throw error
1015
}
1116
}

0 commit comments

Comments
 (0)