conlang: add lang items, remove Empty, and shuffle typeck

This commit is contained in:
2025-09-15 10:45:14 -04:00
parent ead1f351a7
commit f41e5fc49a
26 changed files with 172 additions and 154 deletions

View File

@@ -723,9 +723,12 @@ impl Interpret for Cast {
fn interpret(&self, env: &mut Environment) -> IResult<ConValue> {
let Cast { head, ty } = self;
let value = head.interpret(env)?;
if TyKind::Empty == ty.kind {
if let TyKind::Tuple(TyTuple { types }) = &ty.kind
&& types.as_slice().is_empty()
{
return Ok(ConValue::Empty);
};
}
let TyKind::Path(Path { absolute: false, parts }) = &ty.kind else {
Err(Error::TypeError())?
};