runtime, macros: unify NaN-boxed value API under ValueVariant trait
This commit is contained in:
@@ -13,7 +13,7 @@ pub(crate) fn op_lookup_with<'gc, M: Machine<'gc>>(
|
||||
mc: &gc_arena::Mutation<'gc>,
|
||||
) -> Step {
|
||||
#[allow(clippy::unwrap_used)]
|
||||
let counter = m.peek_forced(0).as_inline::<i32>().unwrap();
|
||||
let counter = m.peek_forced(0).downcast::<i32>().unwrap();
|
||||
|
||||
let name = reader.read_string_id();
|
||||
let n = reader.read_u8();
|
||||
@@ -57,7 +57,7 @@ pub(crate) fn op_lookup_with<'gc, M: Machine<'gc>>(
|
||||
};
|
||||
|
||||
if let Some(val) = namespace
|
||||
.as_gc::<AttrSet>()
|
||||
.downcast::<AttrSet>()
|
||||
.and_then(|attrs| attrs.lookup(name))
|
||||
{
|
||||
m.replace(0, val);
|
||||
@@ -67,7 +67,7 @@ pub(crate) fn op_lookup_with<'gc, M: Machine<'gc>>(
|
||||
Symbol::from(ctx.resolve_string(name))
|
||||
)));
|
||||
} else {
|
||||
m.replace(0, Value::new_inline(counter + 1));
|
||||
m.replace(0, Value::new(counter + 1));
|
||||
reader.set_pc(resume_pc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user