Stream: ideas

Topic: Make `import pf.Elem exposing [Elem]` a warning


view this post on Zulip Luke Boswell (Sep 10 2026 at 00:59):

What do people think about making this a warning? It's redundant and for some reason our Agentic friends love doing it.

import pf.Elem exposing [Elem]

view this post on Zulip Aurélien Geron (Sep 10 2026 at 02:08):

Would import pf.Elem exposing [foo, bar] also expose Elem implicitly?

view this post on Zulip Luke Boswell (Sep 10 2026 at 02:18):

Yes I think so

view this post on Zulip Richard Feldman (Sep 10 2026 at 02:24):

seems reasonable to me! :thumbs_up:

view this post on Zulip Richard Feldman (Sep 10 2026 at 02:25):

also could have the formatter autofix it

view this post on Zulip Richard Feldman (Sep 10 2026 at 02:25):

maybe let's just do that and not give a warning

view this post on Zulip Richard Feldman (Sep 10 2026 at 02:25):

ehh both is probably better actually, that way the warning gives an actual explanation

view this post on Zulip Luke Boswell (Sep 10 2026 at 03:02):

The formatter doesn't have type information so it would have to be a heuristic "same name" thing I guess

view this post on Zulip Luke Boswell (Sep 10 2026 at 03:07):

Made an issue for this https://github.com/roc-lang/roc/issues/11270

view this post on Zulip Richard Feldman (Sep 10 2026 at 03:18):

I think same name is deterministic, right? :thinking:

view this post on Zulip Richard Feldman (Sep 10 2026 at 03:18):

like I don't think type information would matter even if it had access to it :smile:

view this post on Zulip Luke Boswell (Sep 10 2026 at 03:21):

Can I expose a nested type with the same name as the parent?

view this post on Zulip Luke Boswell (Sep 10 2026 at 03:21):

I guess that should not be permitted

view this post on Zulip Luke Boswell (Sep 10 2026 at 03:22):

Elem.Elem.Elem

view this post on Zulip Richard Feldman (Sep 10 2026 at 03:59):

oh hm I guess you can

view this post on Zulip Richard Feldman (Sep 10 2026 at 04:00):

I mean it should be permitted, it's just silly

view this post on Zulip Richard Feldman (Sep 10 2026 at 04:00):

so is the status quo of exposing [Elem] actually a bug?

view this post on Zulip Richard Feldman (Sep 10 2026 at 04:01):

like should it be an error bc that's like trying to expose Elem.Elem, which doesn't exist?


Last updated: Sep 24 2026 at 15:59 UTC