Misspelled identifiers or missing imports can end up as unwanted implicit parameters, as in this example:
inductive Answer where
| yes
| maybe
| no
def select (choices : α × α × α) : Asnwer → α
| Invalid dotted identifier notation: The expected type of `.yes`
Asnwer
is not of the form `C ...` or `... → C ...` where C is a constant
.yes => choices.1
| .maybe => choices.2.1
| .no => choices.2.2
The resulting error message states that the argument's type is not a constant, so dot notation cannot be used in the pattern:
Invalid dotted identifier notation: The expected type of `.yes`
Asnwer
is not of the form `C ...` or `... → C ...` where C is a constant
This is because the signature is:
select.{u_1, u_2}
{α : Type u_1}
{Asnwer : Sort u_2}
(choices : α × α × α) :
Asnwer → α
Disabling relaxed automatic implicit parameters makes the error more clear, while still allowing the type to be inserted automatically:
set_option relaxedAutoImplicit false
def select (choices : α × α × α) : Unknown identifier `Asnwer`
Asnwer → α
| .yes => choices.1
| .maybe => choices.2.1
| .no => choices.2.2
Unknown identifier `Asnwer`
Correcting the error allows the definition to be accepted.
set_option relaxedAutoImplicit false
def select (choices : α × α × α) : Answer → α
| .yes => choices.1
| .maybe => choices.2.1
| .no => choices.2.2
Turning off automatic implicit parameters entirely leads to the definition being rejected:
set_option autoImplicit false
def select (choices : Unknown identifier `α`
α × Unknown identifier `α`
α × Unknown identifier `α`
α) : Answer → Unknown identifier `α`
α
| .yes => choices.1
| .maybe => choices.2.1
| .no => choices.2.2