fix: allow LCNF discriminant to have any type
This commit is contained in:
parent
30c75b4b88
commit
61edf19334
1 changed files with 4 additions and 3 deletions
|
|
@ -150,9 +150,10 @@ partial def checkCases (c : Cases) : CheckM Expr := do
|
|||
let mut hasDefault := false
|
||||
checkFVar c.discr
|
||||
let discrType ← inferFVarType c.discr
|
||||
let .const declName _ := discrType.headBeta.getAppFn | throwError "unexpected LCNF discriminant type {discrType}"
|
||||
unless c.typeName == declName do
|
||||
throwError "invalid LCNF `{c.typeName}.casesOn`, discriminant has type{indentExpr discrType}"
|
||||
unless discrType.isAnyType do
|
||||
let .const declName _ := discrType.headBeta.getAppFn | throwError "unexpected LCNF discriminant type {discrType}"
|
||||
unless c.typeName == declName do
|
||||
throwError "invalid LCNF `{c.typeName}.casesOn`, discriminant has type{indentExpr discrType}"
|
||||
for alt in c.alts do
|
||||
let type ←
|
||||
match alt with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue