From fdc57adf5645a27bc26976375bd48b0c5316b9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Fri, 19 Feb 2021 18:04:38 +0100 Subject: Update src/lib.rs --- src/vm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vm.rs') diff --git a/src/vm.rs b/src/vm.rs index 468e5df..020e90c 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -280,7 +280,7 @@ impl VM { Value::Function(ups, block) }, value => error!(self, - ErrorKind::RuntimeTypeError(op, vec![value.clone()]), + ErrorKind::ValueError(op, vec![value.clone()]), format!("Not a function {:?}.", value)), }; self.constants[slot] = constant; @@ -601,7 +601,7 @@ impl VM { let field = self.string(field); if let Value::Instance(ty, _) = inst { - let ty = &self.blobs[ty].fields.get(field).unwrap().1; + let ty = &ty.fields.get(field).unwrap().1; let expected = Type::from(&value); if ty != &expected { error!(self, ErrorKind::TypeMismatch(expected, ty.clone()), -- cgit v1.2.1