lpil / snag

⛵ A boilerplate-free ad-hoc error type

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve error message when using wrong syntax to import a type

xhh opened this issue · comments

commented

Code:

import gleam/io
import gleam/string.{inspect}
import snag.{Result, Snag}

pub fn main() {
  let r: snag.Snag = snag.new("hello")
  io.println(inspect(r))
}

Error:

Unknown module field

Did you mean `error`?

The module `snag` does not have a `Result` value.

OS: Windows 11

Hello! The syntax is import snag.{type Result}

Let's improve this error message.

commented

Ah, thanks!
Another issue of mine can be closed as well then.