Skip to content

Unexpected behavior importing nested modules with the same name #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brson opened this issue May 13, 2011 · 2 comments
Closed

Unexpected behavior importing nested modules with the same name #370

brson opened this issue May 13, 2011 · 2 comments

Comments

@brson
Copy link
Contributor

brson commented May 13, 2011

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.

@marijnh
Copy link
Contributor

marijnh commented May 13, 2011

Actually, in my view of things this is a problem with the name-collision-detection. It should, once I get around to https://github.com/graydon/rust/issues/369 produce an error about binding 'foo' to two different things in the module.

@brson
Copy link
Contributor Author

brson commented May 13, 2011

That sounds good to me. I thought they might be related after I logged it.

@marijnh marijnh closed this as completed May 19, 2011
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
calebzulawski added a commit to calebzulawski/rust that referenced this issue Nov 19, 2023
Eliminate use of `#[cfg_attr(not(doc), repr(transparent))]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants