gleam-lang / suggestions

📙 A place for ideas and feedback
26 stars 2 forks source link

Warnings from dependencies shouldn't appear #97

Closed sharno closed 3 years ago

sharno commented 3 years ago

I was building cowboy and this warning message appeared:


warning: Unused constructor
  ┌─ \\?\C:\Users\sharno\projects\cowboy\_build\default\lib\gleam_http\src\gleam\http\middleware.gleam:1:55
  │
1 │ import gleam/http.{Delete, Patch, Post, Put, Request, Response, Service}
  │                                                       ^^^^^^^^

The constructor Response is never used, it can be safely removed.

I think warnings from dependencies shouldn't appear for the package being built?

lpil commented 3 years ago

A good suggestion! I've worked in languages where this does happen and in ones where this does not. I would be interested in hearing what others have to say here.

CrowdHailer commented 3 years ago

I sort of like that dependency warnings do show. Though I could be persuaded either way.

For the particular example shared above I like that it's probably the easiest thing to fix in gleam_cowboy and therefore highlighted as a nice first contribution for someone.

lpil commented 3 years ago

In future deps will only be compiled once, so the warning will be shown only that first time like in Elixir. I think this will be a good solution for this.