Skip to content

Unexpected behavior importing nested modules with the same name #370

Closed
@brson

Description

@brson

The following test results in items in the inner foo not being resolved even though the compiler let us import foo::foo

import foo::foo;

mod foo {  
  mod foo {
    fn baz() {
    }
  }
}

fn main() {
  // error: unresolved name: baz                                                                         
  foo::baz();
}

Also, using import foo = foo::foo has the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions