Skip to content

Namespaced literals: Internal error expression leaks into diagnostic #172

@fmease

Description

@fmease

Given

use null.L
X: extern.core.type.Type = L.0

The error message goes as follows:

error[E021]: the binding ‘null’ is not defined in this scope
  ┌─ /home/fmease/programming/lushui/err.lushui:1:5
  │
1 │ use null.L
  │     ════

error: binding ‘L’ is not a data type
  ┌─ /home/fmease/programming/lushui/err.lushui:2:28
  │
2 │ X: extern.core.type.Type = L.0
  │                            ═ a error
  │
  ├─ /home/fmease/programming/lushui/err.lushui:2:30
  │
2 │ X: extern.core.type.Type = L.0
  │                              ─ literal requires a data type as its namespace

Ideally, we should not emit the second diagnostic at all.
Apart from that, we should probably refactor how we display entity kinds (I assume). Even though entity kind Error (displayed as error) should not be leaked, we should use the correct article: an error, not a error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: DiagnosticsT-bugType: Something isn't working as intended

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions