I'm working on this issue
I _think_ I've tracked down where I should check for the imports. compiler/parse/src/module.rs
line 105. The interface_header
function. It seems like this is where the imports are parsed as a collection. In my example code, I only have one import so I'm just taking the only item from the collection and matching on the Result
but the type I end up with is tripping me up.
I end up with &roc_region::all::Loc<ast::Spaced<header::ImportsEntry>>
I think I want to somehow check to see if the parsed Module name in the same function matches a Module found in the imports
collection
Rather than doing the checking during parsing, you may want to take a look at parse_header
and/or send_header
in compiler/load_internal/src/file.rs
, and perform the checking there. The reason being, this is more of a semantic error than a parse error. Line 2860 of load_internal/src/file.rs
should give you an imports
type that's easier to examine.
@Ayaz Hafiz ahhh ok, thanks so much!
Last updated: Jul 06 2025 at 12:14 UTC