Zulip Chat Archive

Stream: general

Topic: rcases with new style classes


Eric Rodriguez (Apr 22 2023 at 14:23):

As an example, consider this:

import tactic.rcases
class foo := (bar :   )

class foobar extends foo := (zero : 1 = bar 2)

example (h : foobar) : false :=
begin
  unfreezingI { rcases h with a, b⟩, },
end

I would expect this code to unpack this. And indeed it does, if you change _either_ or both of the classes to structure. But for some reason this doesn't work at all when they are both classes. What's going on? How am I meant to use rcases in this case?

Eric Wieser (Apr 22 2023 at 16:20):

Does @⟨a, b⟩ as a pattern work?

Eric Rodriguez (Apr 22 2023 at 19:10):

that does work, thanks! weird that that's needed

Eric Wieser (Apr 22 2023 at 20:29):

It's because base classes to class constructors are (typeclass) implicit arguments and so aren't included in anonymous constructor notation


Last updated: Dec 20 2023 at 11:08 UTC