Module 导入的数据类型与本地定义的数据类型冲突,即使重命名时也是如此

Module 导入的数据类型与本地定义的数据类型冲突,即使重命名时也是如此,module,agda,Module,Agda,使用下面的Agda代码,我在A中得到了B的定义错误₂: module Whatever where module A₁ where data B : Set where module A₂ where open A₁ renaming (B to B₁) data B : Set where 错误消息是: Duplicate definition of module B. Previous definition of datatype module B at /home/cac

使用下面的Agda代码,我在
A中得到了
B
的定义错误₂

module Whatever where

module A₁ where
  data B : Set where

module A₂ where
  open A₁ renaming (B to B₁)
  data B : Set where
错误消息是:

Duplicate definition of module B. Previous definition of datatype
module B at /home/cactus/prog/agda/modules.agda:4,8-9
when scope checking the declaration
  data B where

但是我将
B
重命名为
B₁在导入上,为什么它仍然冲突?有办法解决吗?

对我来说,这似乎是一个Agda错误。您可以在中报告错误。

问题在于数据类型定义了模块和名称。您还需要重命名该模块。这项工作:

module Cactus where

module A₁ where
  data B : Set where

module A₂ where
  open A₁ renaming (B to B₁; module B to B₁)
  data B : Set where
这允许您以模块式的方式引用构造函数,因此如果
Level.suc
一,你可以写
ℕ.suc
并使其工作,而无需通过重命名shenangians。

作为文件归档;一旦有人承认这是一个bug,我就会接受这个答案。