-
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
Equality on types with Any
as LHS does not work
#5612
Comments
If we implement #6300 then |
Why |
When the engine executes This problem is related to #6216. This is also the reason why, e.g., Note that, however, I know this is all really kind of a mess. This is why there is a huge discussion in #6216 that should resolve this, and all the related problems with instance VS static methods, once and for all. |
The discussion in #6216 is huge and touches a lot of important topics including syntax of the Enso language. As such I'd like to reword your conclusion Pavel: #6300 is a small and non-controversial subset of the #6216 discussion with as limited scope as possible - only methods defined on
Not only #6300 solves this problem, but there are other "duplicates" it solves as well. As such #6300 got a "go" yesterday. However I wouldn't say it fixes "everything for once and all" - that's the goal for #6216 which remains open for discussion. |
#6300 got integrated, but alas, Additions to #6300Every instance method defined on To invoke any instance method (defined on
Current behavior on Any.to_text
>>> org.enso.interpreter.runtime.callable.function.Function - that's wrong, we need defaulted self
Any.to_text self=Boolean
>>> Boolean - good
> Any.to_text Boolean
>>> Boolean - good
> Any.to_text...
>>> org.enso.interpreter.runtime.callable.function.Function - that's correct the same would work for > Any == Boolean
>>> org.enso.interpreter.runtime.callable.function.Function - that's wrong, we need defaulted self
> Any.== self=Any Boolean
>>> false - good
> Any.== Any Boolean
>>> false - good
> Any.== self=Boolean Boolean
>>> true - good
> Any.==...
>>> org.enso.interpreter.runtime.callable.function.Function - that's correct Nothing from the above is new, all the code already parses and runs somehow. For example following code already behaves as needed: > f = Any.==...
> f
>>> org.enso.interpreter.runtime.callable.function.Function
> f self=Boolean Boolean
>>> true
> f Boolean Boolean
>>> true
> f Any Boolean
>>> false What doesn't work is: > f Boolean
>>> org.enso.interpreter.runtime.callable.function.Function - with defaulted self, this'd be false
> f Any
>>> org.enso.interpreter.runtime.callable.function.Function - this should be true We just need to provide the defaulted |
I wasn't aware of this ticket. Will add it to my list of follow ups. |
Pavel Marek reports a new STANDUP for today (2023-06-14): Progress: - Looking at relevant discussions, fiddling around
|
Pavel Marek reports a new STANDUP for yesterday (2023-06-15): Progress: Writing some tests, gathering information from relevant issues. It should be finished by 2023-06-20. |
Pavel Marek reports a new STANDUP for today (2023-06-16): Progress: - Finally understood the specification that is desired.
|
I believe you need to append (not prepend) the default |
Pavel Marek reports a new STANDUP for today (2023-06-19): Progress: - Still hacking
|
Pavel Marek reports a new STANDUP for today (2023-06-20): Progress: - More progress on the Any static method calls.
|
Pavel Marek reports a new 🔴 DELAY for yesterday (2023-06-21): Summary: There is 3 days delay in implementation of the Equality on types with I introduced a hack and I am not sure it will be accepted by reviewers. Delay Cause: A slight delay of PR reviews. |
Pavel Marek reports a new STANDUP for yesterday (2023-06-21): Progress: - Resolved more issues, tests seem to be passing now. It should be finished by 2023-06-23. |
Pavel Marek reports a new STANDUP for today (2023-06-22): Progress: - Integrated all the PR review, all tests are passing.
|
Any == Boolean
returns a functionAny.type.==
instead ofFalse
. This is because it resolves asAny.type.== Any Boolean
method call (which expects 3 arguments rather than 2). Note thatBoolean == Any
returnsFalse
as expected, because it resolves toAny.== Boolean Any
May be related to #4077
Related pending test: https://github.com/enso-org/enso/blob/develop/test/Tests/src/Semantic/Equals_Spec.enso#L172
The text was updated successfully, but these errors were encountered: