-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etc
Milestone
Description
Not a bug, but what I think should be the proper priority of error reporting.
The real issue comes from a large codebase where a x := y
operation def is declared.
If the user accidentally forgets to use :
, then the compiler goes on ahead and typechecks x = y
, even if x
is a val, where it can know ahead of time and just report the reassignment to val
error instead. The typecheck error can be very confusing where :=
relies on a typeclass argument.
Compiler version
v3.2.0
Minimized code
val x = "MyString"
x = 5
Output
Found: (5 : Int)
Required: String
Expectation
I expect the error to be Reassignment to val x
.
Metadata
Metadata
Assignees
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etc