File tree 3 files changed +31
-3
lines changed
3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change
1
+ package test .cask
2
+
3
+ import scala .language .experimental .macros
4
+
5
+ object VersionSpecific {
6
+
7
+ // See src-3/VersionSpecific for a comment on why we can't use
8
+ // `utest.compileError` directly in Scala 3.
9
+ def compileError (expr : String ): utest.CompileError = macro utest.asserts.Asserts .compileError
10
+
11
+ }
Original file line number Diff line number Diff line change
1
+ package test .cask
2
+
3
+ import utest ._
4
+
5
+ object VersionSpecific {
6
+
7
+ // This is a workaround for https://github.com/lampepfl/dotty/issues/11630.
8
+ // The essence of the issue is that between Dotty 3.0.0-M3 and 3.0.0-RC1 the
9
+ // inliner and typer phases were decoupled. Since utest defines
10
+ // `compilerError` as `transparent` in order to propagate error position
11
+ // information, it no can no longer catch compilation errors resulting from
12
+ // inlines. However, since cask heavily uses macros, we need the old behavior
13
+ // to check for error cases. Hence, to work around the issue, we forward to
14
+ // utest, but this time without the `transparent` modifier.
15
+ inline def compileError (inline expr : String ): utest.CompileError = utest.compileError(expr)
16
+
17
+ }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ object FailureTests extends TestSuite {
12
12
13
13
val tests = Tests {
14
14
" mismatchedDecorators" - {
15
- val m = utest .compileError("""
15
+ val m = VersionSpecific .compileError("""
16
16
object Decorated extends cask.MainRoutes{
17
17
@myDecorator
18
18
@cask.websocket("/hello/:world")
@@ -24,7 +24,7 @@ object FailureTests extends TestSuite {
24
24
}
25
25
26
26
" noEndpoint" - {
27
- utest .compileError("""
27
+ VersionSpecific .compileError("""
28
28
object Decorated extends cask.MainRoutes{
29
29
@cask.get("/hello/:world")
30
30
@myDecorator()
@@ -36,7 +36,7 @@ object FailureTests extends TestSuite {
36
36
}
37
37
38
38
" tooManyEndpoint" - {
39
- utest .compileError("""
39
+ VersionSpecific .compileError("""
40
40
object Decorated extends cask.MainRoutes{
41
41
@cask.get("/hello/:world")
42
42
@cask.get("/hello/:world")
You can’t perform that action at this time.
0 commit comments