Open radeusgd opened 6 days ago
I am facing the "cycle in IR" problem while working on
The cycle goes from Argument
an cycles thru:
[error] at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:531)
[error] at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:474)
[error] at org.enso.compiler.pass.resolve.TypeSignatures$Signature.duplicate(TypeSignatures.scala:369)
[error] at org.enso.compiler.core.ir.MetadataStorage.duplicate(MetadataStorage.java:98)
[error] at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:531)
[error] at org.enso.compiler.core.ir.Name$Literal.duplicate(Name.scala:474)
In #11399 I'm introducing
StaticModuleScope
needed to be able to resolve method calls on atoms. It has some resemblance toBindingsMap
but it is a bit 'higher-level' - instead of holding raw IR expressions, it contains type representations that are not part of raw IR. It was needed to reflect the runtimeModuleScope
.Since it's available, the resolution of atom constructors in type propagation could also rely on
StaticModuleScope
instead ofBindingsMap
. This will allow us to remove the addedtypReference
expression fromArgument
type which will get rid of a problematic cycle in the IR. This should then fix an issue withduplicate
that does not like cycles in the IR.