File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -362,4 +362,7 @@ private opaque evalFilePath (stx : Syntax) : TermElabM System.FilePath
362
362
mkStrLit <$> IO.FS.readFile path
363
363
| _, _ => throwUnsupportedSyntax
364
364
365
+ @[builtin_term_elab Lean.Parser.Term.namedPattern] def elabNamedPatternErr : TermElab := fun stx _ =>
366
+ throwError "`<identifier>@<term>` is a named pattern and can only be used in pattern matching contexts{indentD stx}"
367
+
365
368
end Lean.Elab.Term
Original file line number Diff line number Diff line change
1
+ /--
2
+ error: `<identifier>@<term>` is a named pattern and can only be used in pattern matching contexts
3
+ p@()
4
+ -/
5
+ #guard_msgs in
6
+ def minimal : Unit -> Unit := by
7
+ intro i
8
+ let k:p@() := i
9
+ sorry
10
+
11
+ def minimal2 : Unit -> Unit := by
12
+ intro i
13
+ let p@k:() := i
14
+ guard_hyp k : p = ()
15
+ exact ()
You can’t perform that action at this time.
0 commit comments