-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework compile time error message for scala 3 (#145)
This includes more information in the error message that is generated when a route declaration has an invalid return type. It notably also includes the source position, as discussed in #141.
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test.cask | ||
|
||
import cask.model.Request | ||
import utest._ | ||
|
||
object FailureTests3 extends TestSuite { | ||
val tests = Tests{ | ||
"returnType" - { | ||
utest.compileError(""" | ||
object Routes extends cask.MainRoutes{ | ||
@cask.get("/foo") | ||
def hello(world: String) = (1, 1) | ||
initialize() | ||
} | ||
""").msg ==> | ||
"error in route definition `def hello` (at tasty-reflect:4:15): the method's return type scala.Tuple2[scala.Int, scala.Int] cannot be converted to the expected response type cask.model.Response[cask.model.Response.Data]" | ||
} | ||
} | ||
} |