Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make constructor-as-variable test more robust #4625

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions tests/lean/run/constructor_as_variable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,18 @@ def x : A := A.x

/-! Test the interaction with the invalid match pattern error messages -/

inductive MyProd where
| construct : Nat → Nat → MyProd

/--
error: invalid pattern, constructor or constant marked with '[match_pattern]' expected

Suggestions:
'Add.mk',
'Alternative.mk',
'AndOp.mk',
'AndThen.mk',
'Antisymm.mk',
'Append.mk',
'Applicative.mk',
'Array.Mem.mk',
'Array.mk',
'BEq.mk',
(or 201 others)
Suggestion: 'MyProd.construct' is similar
-/
#guard_msgs in
def ctorSuggestion1 (pair : α × β) : β :=
def ctorSuggestion1 (pair : MyProd) : Nat :=
match pair with
| mk x y => y
| construct x y => y

-- This test is a realistic situation if a user doesn't know how Lean namespaces work
/--
Expand Down
Loading