Open
Description
Compiler version
Minimized example
def fun1(i: Int): Double = ???
def fun2(d: Double): Double = ???
export fun1.apply, fun2.unlift
Output Error/Warning message
-- [E083] Type Error: /home/kpi/bugs/export-better-errors.scala:5:7 ------------
5 |export fun1.apply, fun2.unlift
| ^^^^
|Int => Double is not a valid export prefix, since it is not an immutable path
|
| longer explanation available when compiling with `-explain`
-- [E083] Type Error: /home/kpi/bugs/export-better-errors.scala:5:19 -----------
5 |export fun1.apply, fun2.unlift
| ^^^^
| Any is not a valid export prefix, since it is not an immutable path
|
| longer explanation available when compiling with `-explain`
-- Error: /home/kpi/bugs/export-better-errors.scala:5:24 -----------------------
5 |export fun1.apply, fun2.unlift
| ^^^^^^
| no eligible member unlift at {
| def $anonfun(d: Double): Double = fun2(d)
| closure($anonfun:Any)
| }
Why this Error/Warning was not helpful
The first error message is helpful, but the rest are confusing. Any
is inferred for fun2
most likely because of the previous error, and the last error shows some desugared/eta-expanded code, which is also a side effect of the previous error.
Suggested improvement
The last error shouldn't be shown. One possibility is to make the positions the same for the first and last errors.