rue_compiler/compile/ty/path.rs
1use log::debug;
2use rue_ast::{AstNode, AstPathType};
3use rue_types::TypeId;
4
5use crate::{Compiler, PathKind, PathResult, compile_path};
6
7pub fn compile_path_type(ctx: &mut Compiler, path: &AstPathType) -> TypeId {
8 let PathResult::Type(ty, _) =
9 compile_path(ctx, path.syntax(), path.segments(), PathKind::Type, true)
10 else {
11 debug!("Unresolved path type {}", path.syntax().text());
12 return ctx.builtins().unresolved.ty;
13 };
14
15 ty
16}