resolve: Allow idents to resolve to primitives in the type namespace
This commit is contained in:
parent
a0d40f8bdf
commit
041a612dad
1 changed files with 8 additions and 0 deletions
|
|
@ -1726,6 +1726,14 @@ impl<'a> Resolver<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
if ns == TypeNS {
|
||||
if let Some(prim_ty) = self.primitive_type_table.primitive_types.get(&ident.name) {
|
||||
let binding = (Res::PrimTy(*prim_ty), ty::Visibility::Public,
|
||||
DUMMY_SP, ExpnId::root()).to_name_binding(self.arenas);
|
||||
return Some(LexicalScopeBinding::Item(binding));
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue