Description
Compiler version
3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-4c76323
Minimized code
Passing -Xprompt
allows us to interactively obtain the stacktrace when the compiler prints an error message (very very useful!). However, that does not work properly from within an sbt
session, e.g., when working on the compiler itself. Say we have an erroneous program in foo.scala
, and invoke scalac -Xprompt foo.scala
:
-- [E103] Syntax Error: foo.scala:1:0 ------------------------------------
1 |"dumb"
|^
|Illegal start of toplevel definition
|
| longer explanation available when compiling with `-explain`
a)bort, s)tack, r)esume:
Output
With a precompiled scalac
binary, it'll work fine (can press a
, s
, or r
and it does its magic), but invoking the sbt
task of the same name in the compiler code base will not accept any input.
Bonus: In a "decent" terminal emulator (e.g., iterm2) we can abort with ctrl-c
, but using the VSCode builtin terminal (connecting with sbt --client
to Metal's sbt
instance), not even that will work and we are completely stuck (need to kill VSCode & orphan java
processes left behind).
Expectation
It works from within an sbt
session just the same as with the precompiled binary.
Edit: + it should also work with scala3-bootstrapped/scalac