resolve: Allow idents to resolve to primitives in the type namespace

This commit is contained in:
Gabriel Smith 2019-11-18 14:22:00 -05:00
parent a0d40f8bdf
commit 041a612dad

View file

@ -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
}