fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
7 stars 0 forks source link

Wrong span when reporting invalid data type instances #31

Open fmease opened 4 years ago

fmease commented 4 years ago

Example:

use extern.core.type.Type

data Thing: Type of
    thing: Kind

Kind: Type = Type

Confusing error message:

error[E033]: ‘extern.core.type.Type’ is not an instance of ‘topmost.Thing’
  ┌─ /home/fmease/programming/lushui/wh.lushui:6:14
  │
6 │ Kind: Type = Type
  │              ════

We use the span of the evaluated expression, not the one of the unevaluated one we should use.