Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cycles from IR by migrating the type inference pass to use the StaticModuleScope metadata instead of BindingsMap #11509

Open
radeusgd opened this issue Nov 7, 2024 · 1 comment
Assignees
Labels
-compiler -type-system Category: type system and type inference

Comments

@radeusgd
Copy link
Member

radeusgd commented Nov 7, 2024

In #11399 I'm introducing StaticModuleScope needed to be able to resolve method calls on atoms. It has some resemblance to BindingsMap 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 runtime ModuleScope.

Since it's available, the resolution of atom constructors in type propagation could also rely on StaticModuleScope instead of BindingsMap. This will allow us to remove the added typReference expression from Argument type which will get rid of a problematic cycle in the IR. This should then fix an issue with duplicate that does not like cycles in the IR.

@radeusgd radeusgd added -type-system Category: type system and type inference -compiler labels Nov 7, 2024
@radeusgd radeusgd self-assigned this Nov 7, 2024
@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Nov 7, 2024
@JaroslavTulach
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler -type-system Category: type system and type inference
Projects
Status: New
Development

No branches or pull requests

2 participants