Improve error message when using wrong syntax to import a type
xhh opened this issue · comments
xhh 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
Louis Pilfold commented
Hello! The syntax is import snag.{type Result}
Louis Pilfold commented
Let's improve this error message.
xhh commented
Ah, thanks!
Another issue of mine can be closed as well then.