目录

如何解决编译报错“Declaration merging is not supported(arkts-no-decl-merging)” 或 “Cannot redeclare block-scoped variable 'xxx'”的问题

问题现象

在不同的文件中声明相同变量、interface、enum等类型,DevEco Studio不报错,但编译时会报错。

解决方案

如果文件中不包含export关键字,该文件将视为全局命名空间的一部分。