Stream: beginners

Topic: ✔ transitive imports


view this post on Zulip jan kili (Sep 28 2022 at 02:24):

Can an interface import from another interface?

view this post on Zulip jan kili (Sep 28 2022 at 02:25):

I expected yes, as an interface has an import section in its header... but it's just freezing/hanging the type checker

view this post on Zulip Ayaz Hafiz (Sep 28 2022 at 02:25):

yes

view this post on Zulip Ayaz Hafiz (Sep 28 2022 at 02:25):

do you have a minimal reproducer?

view this post on Zulip jan kili (Sep 28 2022 at 02:25):

one moment

view this post on Zulip jan kili (Sep 28 2022 at 02:26):

:face_palm:

view this post on Zulip jan kili (Sep 28 2022 at 02:26):

nevermind.

view this post on Zulip jan kili (Sep 28 2022 at 02:26):

Fun edge case, though!

view this post on Zulip Ayaz Hafiz (Sep 28 2022 at 02:28):

was it a cyclic import?

view this post on Zulip jan kili (Sep 28 2022 at 02:28):

Foo.roc

interface Foo
    exposes []
    imports [Bar]

baz = Bar.baz

Bar.roc

interface Foo
    exposes [baz]
    imports []

baz = 123
jan@mackey rocbox % roc check Bar.roc
0 errors and 0 warnings found in 13 ms.
jan@mackey rocbox % roc check Foo.roc

view this post on Zulip jan kili (Sep 28 2022 at 02:28):

Naming the child the same as the parent hangs the type checker

view this post on Zulip Ayaz Hafiz (Sep 28 2022 at 02:28):

ah yeah. that’s been a long standing open issue

view this post on Zulip jan kili (Sep 28 2022 at 02:29):

A copy/paste mistake, and an easy one to make :/

view this post on Zulip Ayaz Hafiz (Sep 28 2022 at 02:29):

probably worth bumping the priority on that issue. it happens way too often

view this post on Zulip jan kili (Sep 28 2022 at 02:30):

https://github.com/roc-lang/roc/issues/3440
and/or
https://github.com/roc-lang/roc/issues/4050
?

view this post on Zulip jan kili (Sep 28 2022 at 02:31):

Bumped. Thank you, @Ayaz Hafiz !

view this post on Zulip Lucasrezzaghi (Sep 28 2022 at 12:18):

I don't know, but could this issue be related somehow?
https://github.com/roc-lang/roc/issues/4094

view this post on Zulip jan kili (Sep 28 2022 at 13:00):

Yes, it looks like interface/module resolution has one or more ways to get silently stuck, which is frustrating for app developers (as is having to put all interfaces in the same directory as your app)

view this post on Zulip Ayaz Hafiz (Oct 04 2022 at 13:46):

This should all be fixed by https://github.com/roc-lang/roc/pull/4125

view this post on Zulip Ayaz Hafiz (Oct 04 2022 at 13:47):

I was going to mark this topic as resolved but looks like I don't have sufficient permissions

view this post on Zulip Notification Bot (Oct 04 2022 at 13:50):

Anton has marked this topic as resolved.

view this post on Zulip jan kili (Oct 04 2022 at 19:22):

:tada: Thank you, @Ayaz Hafiz & @Folkert de Vries !


Last updated: Jul 06 2025 at 12:14 UTC