Iltotore / iron

Strong type constraints for Scala
https://iltotore.github.io/iron/docs/
Apache License 2.0
427 stars 37 forks source link

Better diagnostics for compile-time errors #227

Closed Iltotore closed 1 month ago

Iltotore commented 4 months ago

When a compile-time error occurs due to the value to refine not being evaluable at compile-time, the message can be quite confusing for newcomers. It would be useful to detect some easy mistakes (such as forgetting an inline) when such error occurs and provide a better message accordingly.

Example:

val notInlined: Int = 5
val pos: Int :| Positive = notInlined //`notInlined` is not a non-inlined variable. You need to make it `inline` in order to check it at compile-time etc.

Errors worth detecting are: