Zulip Chat Archive
Stream: lean4
Topic: dotted identifier notation error
Yuri de Wit (Jan 17 2023 at 21:05):
Consider the following example:
inductive Term
| cell
inductive Equation (α: Type := Term)
| act (l: α) (r: α)
def test1 : List Equation → List Equation
| .act c c1 :: eqns => []
| [] => []
def test0 : List (Equation RuleTerm) → List (Equation RuleTerm)
| .act c c1 :: eqns => []
| [] => []
Here, test0
and test1
work as expected.
However, the following example does not work:
inductive RuleTerm
| cell
abbrev RuleEquation := Equation RuleTerm
def test2 : List RuleEquation → List RuleEquation
| .act c c1 :: eqns => [] -- ERROR! invalid dotted identifier notation, unknown identifier `RuleEquation.act` from expected type RuleEquation
| [] => []
Fixing this is easy: use Equation.act
instead of .act
. However, should this be considered a bug or as-designed?
Last updated: Dec 20 2023 at 11:08 UTC