Stream: bugs

Topic: Imports with same module names


view this post on Zulip Jonathan (Jul 17 2026 at 22:52):

I'm supposing this is a bug but it's equally plausible I've misunderstood something about imports: the following errors with Random.seed does not exist - random.Random is in scope, but it has no associated seed.

app [main!] {
    pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.21.0-rc4/FvCh4vdqm3nBY6DWEfZ8RuGCVfjuMY43HA8KSNk9qVDn.tar.zst",
    random: "https://github.com/kili-ilo/roc-random/releases/download/0.7.0/2LdxsJEfiBKwTBZc8SF1SidGC68wKCvfAwVREwWKwZu7.tar.zst"
}

import pf.Random as PfR
import random.Random

main! = |_| {
    gen = Random.seed(PfR.seed_u32!()?)

    Ok({})
}

I thought that aliasing the import to PfR would be sufficient? I thought I might be able to access via a fully qualified name (pf.Random.seed and random.Random.seed_u64!) but I suppose not, as I get an error telling me I am doing incorrect record access syntax.

view this post on Zulip Luke Boswell (Jul 17 2026 at 23:00):

Most likely at least one bug in here somewhere

view this post on Zulip Jonathan (Jul 17 2026 at 23:00):

To clarify by the way, importing each on its own works ok, but in combination gives the error.

view this post on Zulip Luke Boswell (Jul 17 2026 at 23:04):

I'm guessing there is something about the as alias or scoping that is interacting here

view this post on Zulip Jonathan (Jul 17 2026 at 23:08):

The error changes depending on which is imported first too. I'll stick it in an issue (#10202)


Last updated: Jul 23 2026 at 13:15 UTC