gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.84k stars 745 forks source link

Compiler error about "unknown module value" could highlight existence of type with the same name #3691

Open michaeljones opened 2 weeks ago

michaeljones commented 2 weeks ago

As reported on Discord.

I'm currently getting an error:

error: Unknown module value
   ┌─ /home/michael/root/projects/gleam-lang/plug/src/wisp/plug.gleam:57:7
   │
57 │   wisp.Request(
   │       ^^^^^^^^

The module `wisp` does not have a `Request` value.

It might be helpful it also said something like "There is a Request type in wisp but that cannot be constructed directly. You need to import a type constructor..." Or something like this? With the right words? And better?

Or maybe that is just too complex in this case as wisp.Request is a type alias for something that isn't normally created directly?

lpil commented 2 weeks ago

Something like "abc.Xyz is a type/type constructor, it cannot be used as a value"?