Do not crash on invalid pattern

Fixes #1213
Fixes #1232
This commit is contained in:
Laurenz 2023-05-19 14:48:48 +02:00
parent 8d4f9304c0
commit e32c6f8e8a

View File

@ -1399,7 +1399,7 @@ impl ast::Pattern {
vm.define(ident, value);
Ok(Value::None)
}
_ => unreachable!(),
_ => bail!(expr.span(), "nested patterns are currently not supported"),
})
}