Native types should have crate-relative identifiers
de91038
Opened by Patrick Walton at
Native type identifiers are global, not crate-relative. This doesn't seem easy to typecheck because of the diamond import problem:
Suppose:
- Crate A defines a native type foo;
- Crate B imports A and exports A.foo;
- Crate C imports A and exports A.foo;
- Crate D imports B and C and unifies B.foo and C.foo.
B.foo and C.foo won't be considered compatible.
Instead of having one global value set, we could subject them to crate-relative name resolution, just like any other type. In other words, we would have e.g. "TY_native of crate_id * native_id".
WONTFIX (not required for bootstrapping; code in rustc is all different. defs are all crate-relative there).
Graydon Hoare at 2011-01-27 02:03:57