-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed assertions in Scala 3 produce unhelpful stack traces (500USD Bounty) #354
Comments
so far my current assumption that in Scala 3 macro implementation of AssertsCompanionVersionSpecific.interceptProxy some expression transformation happen which leads to throwing exception in incorrect place at runtime. At least with few experiments that I did I've not noticed any issue with code that responsible for getting stack trace. |
I don't have a fix yet but what I've found, in case it helps others, is that the logic in If I add a println(s"exprs POS: ${exprs.asTerm.pos.sourceFile}:${exprs.asTerm.pos.startLine}") Then I see:
Note that lines are zero-based, so line 20 is actually line 21 in @malcolmredheron's code -- this is the correct line where the error should be reported. If I then add a println(s"trees POS: ${trees.asTerm.pos.sourceFile}:${trees.asTerm.pos.startLine}") Then I see:
Line 4 is the line with I've tried changing the owner of |
it seems there on line 24 line position information in |
I think I leaped to conclusions prematurely about utest/utest/src-3/utest/asserts/Tracer.scala Line 101 in 76e7fe5
Challenge seems not only how to locate it but what approach should be used to preserve positional information. |
From the maintainer Li Haoyi: I'm putting a 500USD bounty on this issue, payable by bank transfer on a merged PR fixing this.
See https://github.com/orgs/com-lihaoyi/discussions/6 for other bounties and the terms and conditions that bounties operate under
I'm confused by the stack traces that I get when a utest assertion fails in scala 3. Specifically, the only line in the trace that refers to the test file seems to point to the line with
Tests {
on it, not the line of the assertionI forked the utest repo and changed an assertion to fail. Here's how to reproduce it:
./mill utest.jvm[3.3.3].test.testOnly "*HelloTests*"
./mill utest.jvm[2.13.14].test.testOnly "*HelloTests*"
mentions line 21 instead of line 5The text was updated successfully, but these errors were encountered: