runtime, macros: unify NaN-boxed value API under ValueVariant trait
This commit is contained in:
@@ -16,8 +16,8 @@ pub fn to_string<'gc, M: Machine<'gc>>(
|
||||
if val.is::<StringId>() || val.is::<NixString>() {
|
||||
return m.return_from_primop(val.relax(), reader);
|
||||
}
|
||||
if let Some(p) = val.as_inline::<Path>() {
|
||||
return m.return_from_primop(Value::new_inline(p.0), reader);
|
||||
if let Some(p) = val.downcast::<Path>() {
|
||||
return m.return_from_primop(Value::new(p.0), reader);
|
||||
}
|
||||
// TODO: derivations / `__toString` / `outPath`,
|
||||
// numbers, lists.
|
||||
@@ -47,5 +47,5 @@ pub fn type_of<'gc, M: Machine<'gc>>(
|
||||
NixType::Thunk => unreachable!("forced"),
|
||||
};
|
||||
let sid = ctx.intern_string(name);
|
||||
m.return_from_primop(Value::new_inline(sid), reader)
|
||||
m.return_from_primop(Value::new(sid), reader)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user