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, expected type is not of the form (... → C ...) where C is a constant
Asnwer
.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, expected type is not of the form (... → C ...) where C is a constant
Asnwer
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