lpil / snag

⛵ A boilerplate-free ad-hoc error type
Apache License 2.0
46 stars 2 forks source link

Improve error message when using wrong syntax to import a type #3

Closed xhh closed 3 months ago

xhh commented 8 months ago

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

lpil commented 8 months ago

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

lpil commented 8 months ago

Let's improve this error message.

xhh commented 8 months ago

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

bruse commented 3 months ago

I think this is fixed in Gleam v1.2.0 @lpil ?

lpil commented 3 months ago

Yes, thank you