Support parsing opaque destructures as first item in nested body

Closes #3198
This commit is contained in:
Ayaz Hafiz 2022-07-22 16:35:02 -04:00
parent 53e7a41f27
commit b04764bdd6
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 81 additions and 1 deletions

View file

@ -413,7 +413,9 @@ impl<'a> ExprState<'a> {
let fail = EExpr::BadOperator(opchar, loc_op.region.start());
Err(fail)
} else if !self.expr.value.is_tag() && !self.arguments.is_empty() {
} else if !(self.expr.value.is_tag() || self.expr.value.is_opaque())
&& !self.arguments.is_empty()
{
let region = Region::across_all(self.arguments.iter().map(|v| &v.region));
Err(argument_error(region, loc_op.region.start()))