Skip to content

Confusing source code position in error message #877

@zhongl

Description

@zhongl

Input

```scala mdoc
extension (x: Int)
    def ===(y: Int) = x == y
```

```scala mdoc:fail
1 === ""
```

```scala mdoc:silent
    1 === 1    

```

Command line

coursier launch org.scalameta:mdoc_3:2.5.3 

Output

```scala
extension (x: Int)
    def ===(y: Int) = x == y
```

```scala
1 === ""
// error:
// Found:    ("" : String)
// Required: Int
//     1 === 1
//          ^
```

```scala
    1 === 1

```

Source code position above

//     1 === 1
//          ^

suppose to be

// 1 === ""
//       ^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions