Skip to content

Elab issues with index notation #22

@lecopivo

Description

@lecopivo

I broke the element access notation again

variable {Cont Idx Elem} [IndexType Idx] [Indexed Cont Idx Elem]

variable (x y : Cont)

-- broken
#check Function.HasUncurry.uncurry fun i => x[i]
#check Function.HasUncurry.uncurry fun i j => (x[i],y[j])

-- works
#check Function.HasUncurry.uncurry fun i => (x[i] : Elem)
#check Function.HasUncurry.uncurry fun i j => ((x[i] : Elem),(y[j] : Elem))

Because the x[i] elaboration is postponed until the type of x[i] is known it causes failure to synthesize the instance in HasUncurry.

I'm thinking of going back to using GetElem.getElem instead of Indexed.get. Then the custom element access notation can be implemented just as a macro and the elaboration mess can be completely avoided.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions