This commit is contained in:
Leonardo de Moura 2022-10-08 07:58:56 -07:00
parent 7874c03c27
commit 56002e1b33
3 changed files with 4 additions and 1 deletions

View file

@ -1272,7 +1272,7 @@ private partial def elabAppFn (f : Syntax) (lvals : List LVal) (namedArgs : Arra
LVal.fieldName comp (toString comp.getId) none e
elabAppFn e (newLVals ++ lvals) namedArgs args expectedType? explicit ellipsis overloaded acc
let elabFieldIdx (e idxStx : Syntax) := do
let idx := idxStx.isFieldIdx?.get!
let some idx := idxStx.isFieldIdx? | throwError "invalid field index"
elabAppFn e (LVal.fieldIdx idxStx idx :: lvals) namedArgs args expectedType? explicit ellipsis overloaded acc
match f with
| `($(e).$idx:fieldIdx) => elabFieldIdx e idx

1
tests/lean/1707.lean Normal file
View file

@ -0,0 +1 @@
def y := c.5ÿ

View file

@ -0,0 +1,2 @@
1707.lean:1:9-1:12: error: invalid field index
1707.lean:1:12: error: expected command