-
Notifications
You must be signed in to change notification settings - Fork 334
Semi-formal specification for method resolution #13961
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
Conversation
RFC engine and libs team (@JaroslavTulach , @jdunkerley , @4e6 , @hubertp , @GregoryTravis ): Do you consider this kind of semi-formal specification for method resolution and method evaluation useful? Is it better than looking at our tests or in our code base? Do you want me to finish it? Do you have any other suggestions how to improve it? Note that this PR is WIP, obviously. |
docs/types/dynamic-dispatch.md
Outdated
- Every type has an implicit parent type `Any`. | ||
- Except for `Number` which is a special builtin case with a deeper hierarchy. | ||
- `Any` has no parent type. | ||
- 2.2. No parent type is present. Raise `No_Such_Method` panic and stop. |
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.
- 2.2. No parent type is present. Raise `No_Such_Method` panic and stop. | |
- 2.2. No parent type is present. Raise `No_Such_Method` panic and terminate. |
|
||
### Lexical scope lookup | ||
|
||
- If `symbol` is defined in the current lexical scope, select it and stop. |
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.
- This is not really a "dynamic dispatch"
- but it is an interesting topic
- and complicated - e.g. term like all transitively imported modules sounds scary
- I'd move it to its own "lexical dispatch" document
Co-authored-by: Jaroslav Tulach <[email protected]>
...ion-tests/src/test/java/org/enso/interpreter/node/expression/builtin/meta/TypeChainTest.java
Outdated
Show resolved
Hide resolved
...ion-tests/src/test/java/org/enso/interpreter/node/expression/builtin/meta/TypeChainTest.java
Outdated
Show resolved
Hide resolved
This diff is more important than #13961 (comment) and it’s 7b58937 as it shows the diff against current behavior. Can we make it less red? |
@JaroslavTulach Done. See #13962 (comment) |
var exp1 = raw; | ||
var exp2 = ctx.ensoContext().getBuiltins().any(); | ||
assertArrayEquals( | ||
"allTypes(Singleton_Type.type) == [Singleton_Type.type, Any]", |
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.
Or is it
"allTypes(Singleton_Type.type) == [Singleton_Type.type, Any]", | |
"allTypes(Singleton_Type) == [Singleton_Type, Any]", |
;-?
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 am really not sure about this one. See the line 159 with assertThat("is eigen type", raw.isEigenType(), is(true))
. So I think it should be written as Singleton_Type.type
.
Changes introduced in Type.fillInTypes necessary to make the newly introduced TypeChainTests green, breaks other stuff. For example in https://github.com/enso-org/enso/actions/runs/18308891816/job/52133745709?pr=13961#step:14:1114. Can be reproduced with:
which, on this PR, returns This is caused by the fact, that on develop
|
These will be added to #13962.
|
@JaroslavTulach Tests are again in this PR, with a single ignore. |
Pull Request Description
Semi-formal spec for method invocation. Documents the desired behavior that is being implemented in #13962.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.