Skip to content

//> using option "--explain" does nothing #1285

@Kordyjan

Description

@Kordyjan

Version(s)
0.1.12

Describe the bug
//> using option "--explain" doesn't change the compilation output. Probably it has the same root cause as #1023. The problem goes away if we run scala-cli with --server=false.

To Reproduce
explain.scala:

//> using option "--explain"

class A

val i: Int = A()

Run scala-cli compile explain.scala. The output will be:

[error] ./explain.scala:5:14: Found:    A
[error] Required: Int
[error] val i: Int = A()
[error]              ^^^
Error compiling project (Scala 3.1.3, JVM)
Compilation failed

Expected behaviour

The output should look like this:

-- [E007] Type Mismatch Error: /Users/pmarks/projs/rep/explain.scala:5:14 ------
5 |val i: Int = A()
  |             ^^^
  |             Found:    A
  |             Required: Int
  |-----------------------------------------------------------------------------
  | Explanation (enabled by `-explain`)
  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  |
  | Tree: new A()
  | I tried to show that
  |   A
  | conforms to
  |   Int
  | but the comparison trace ended with `false`:
  |
  |   ==> A  <:  Int
  |   <== A  <:  Int = false
  |
  | The tests were made under the empty constraint
   -----------------------------------------------------------------------------

Metadata

Metadata

Assignees

Labels

SIP-46All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions