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) = compile_path(ctx, path.syntax(), path.segments(), PathKind::Type)
9    else {
10        debug!("Unresolved path type {}", path.syntax().text());
11        return ctx.builtins().unresolved.ty;
12    };
13
14    ty
15}