We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9895e25 commit 5ee1967Copy full SHA for 5ee1967
src/Lean/Compiler/IR/Checker.lean
@@ -159,6 +159,11 @@ def checkExpr (ty : IRType) (e : Expr) : M Unit := do
159
checkObjVar x
160
| .proj i x =>
161
let xType ← getType x;
162
+ /-
163
+ Projections are a valid operation on `tobject`. Thus they should also
164
+ be a valid operation for both `object`, `tagged` and unboxed values
165
+ as they are subtypes.
166
+ -/
167
match xType with
168
| .object | .tobject =>
169
checkObjType ty
@@ -167,6 +172,7 @@ def checkExpr (ty : IRType) (e : Expr) : M Unit := do
172
checkEqTypes (tys[i]) ty
173
else
174
throwCheckerError "invalid proj index"
175
+ | .tagged => pure ()
170
176
| _ => throwCheckerError s!"unexpected IR type '{xType}'"
171
177
| .uproj _ x =>
178
0 commit comments