-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add type constructors #3464
Add type constructors #3464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid adding Scala data structures into the engine code that is supposed to be Partially Evaluated. Converting to plain @CompilationFinal(dimension=1) AtomConstructor[]
shall be enough.
Please make the parentType
and variants
technically immutable after parsing or make sure changes to the fields properly invalidate partially evaluated code depending on them.
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/codegen/RuntimeStubsGenerator.scala
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/phase/StubIrBuilder.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java
Show resolved
Hide resolved
I am trying to reproduce the current (with e47d05a) failures by doing:
There are other tests failing with similar errors. Finding the cause could fix them all. I can debug this by telling my IDE to Socket Listen on port
when the breakpoint stops at Eliminating the duplicity by:
seems to fix the
passes OK. |
rebased my previous work on top of Marcin's patch where it could apply cleanly. This broke my approach for resolving AtomConstructors. I've eliminated his UnionType machinery in favor of heavier AtomConstructors, as we had discussed previously. This needs a pass that appropriately creates the AtomConstructors for complex type declarations. These are apparently now circular, hence the need for @CompilationFinal This does not include static resolution. It does not include a proper mapping to parents that preserve detailed type information and doesn't have name punning support.
* split off just to get the obvious stuff up in an easily reviewed form.
2af39a0
to
0545f7a
Compare
@@ -1,3 +1,3 @@ | |||
type Any | |||
type Any_Tp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the _Tp
suffix stand for? ToP level type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to understand this rename.
Is it temporary? If not, I'm a bit skeptical about the _Tp
suffix. Also we'd probably need to change all type signatures taking Any
to be Any_Tp
instead, right? (And analogously for all the others)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is _Tp
as _TemPorary`?
Pull Request Description
This is a work-in-progress draft PR of what we need to get type constructors to exist for real in the compiler.
Important Notes
This removes ResolvedTypeName, and merges it with ResolvedName. It then expands AtomConstructor with
parentType
andvariants
information.variants
being the name used internally for member types of the parent type.Open issues:
Status: This now pulls the information from the right place, but doesn't yet populate all of that information.
We need to populate the parent side of the code I ported from Marcin's branch and the child portion of my code to make the two engines work together.
I've yet to fully fix the test suite, though I started with a couple of errors due to resource exhaustion that don't appear to be caused by me.
Checklist
Please include the following checklist in your PR:
./run dist
and./run watch
.