Zulip Chat Archive
Stream: lean4
Topic: Automatically generated instance names in modules
Christian Merten (Nov 25 2025 at 05:34):
It seems that automatically generated instance names behave differently in modules:
module
class Foo where
instance : Foo where
/-- error: private declaration `instFoo` has already been declared -/
#guard_msgs in
instance : Foo where
The error message is gone when module is removed. The second instance is then named instFoo_1. Is this known?
Sebastian Ullrich (Nov 25 2025 at 09:19):
I don't think this has been logged as an issue yet but note that it is not new
private class Foo where
private instance : Foo where
/-- error: private declaration `instFoo` has already been declared -/
#guard_msgs in
private instance : Foo where
Last updated: Dec 20 2025 at 21:32 UTC