lean3 icon indicating copy to clipboard operation
lean3 copied to clipboard

Can't refer to anonymous match in section with parameters

Open digama0 opened this issue 8 years ago • 1 comments

Prerequisites

  • [X] Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.

Description

A short code section with the issue:

section
parameter α : Type
include α

def foo : nat := match 0 with _ := 0 end

example : nat := foo._match_1 ()
end

The foo._match_1 reference is interpreted as a field access, even though one can verify that foo._match_1 is the exact name of the anonymous match. Presumably this is due to some shadowing of the foo symbol by the local notation foo caused by the parameter. Are there any suggested workarounds?

digama0 avatar Sep 19 '17 05:09 digama0

Are there any suggested workarounds?

Use @foo._match_1

full example:

section
parameter α : Type
include α

def foo : nat := match 0 with _ := 0 end

example : nat := @foo._match_1 0
end

leodemoura avatar Sep 19 '17 19:09 leodemoura