effc79a613da — Leonard Ritter 13 days ago
* sc_value_unwrap: don't cause an assertion when the target type is opaque
1 files changed, 4 insertions(+), 1 deletions(-)

M src/globals.cpp
M src/globals.cpp +4 -1
@@ 1210,7 1210,10 @@ sc_valueref_t sc_value_wrap(const sc_typ
 
 sc_valueref_t sc_value_unwrap(const sc_type_t *type, sc_valueref_t value) {
     using namespace scopes;
-    auto result = unwrap_value(type, value);
+    ValueRef result;
+    if (!is_opaque(type)) {
+        result = unwrap_value(type, value);
+    }
     if (!result) {
         result = ref(value.anchor(), ArgumentList::from({}));
     }