fix: out-of-bounds array access

This commit is contained in:
Gabriel Ebner 2021-10-15 19:40:09 +02:00 committed by Sebastian Ullrich
parent b3c8ee2923
commit d379cd6853

View file

@ -342,8 +342,7 @@ def checkRuleKind (given expected : SyntaxNodeKind) : Bool :=
given == expected || given == expected ++ `antiquot
def inferMacroRulesAltKind : Syntax → CommandElabM SyntaxNodeKind
| `(matchAltExpr| | $pats,* => $rhs) => do
let pat := pats.elemsAndSeps[0]
| `(matchAltExpr| | $pat:term => $rhs) => do
if !pat.isQuot then
throwUnsupportedSyntax
let quoted := getQuotContent pat