Only bind register captures

This commit is contained in:
Andrew Morris
2023-03-24 14:40:31 +11:00
parent 5931d8a8f9
commit 9efd517980

View File

@@ -1114,7 +1114,10 @@ impl<'a> ExpressionCompiler<'a> {
for cap in captures {
bind_values.values.push(match self.fnc.lookup_name_id(cap) {
Some(v) => v,
Some(v) => match v {
Value::Register(_) => v,
_ => continue,
},
None => {
self.fnc.diagnostics.push(Diagnostic {
level: DiagnosticLevel::InternalError,
@@ -1122,7 +1125,7 @@ impl<'a> ExpressionCompiler<'a> {
span: cap.span(),
});
Value::Void
continue;
}
});
}