-
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
Binary operator resolution based on that
value
#8779
Conversation
We have three failing tests: That outlines what kind of |
...ntime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/EqualsComplexNode.java
Show resolved
Hide resolved
Need to solve f5 d failure. It is a recent regression. 0542f48 should do the trick. |
ae09192
to
080c977
Compare
234417a adds new paragraph to operators docs. The paragraph follows the section that states Enso only supports binary operators (enforced by #8789). The next sections talk about operator priorities - that's very likely untrue/outdated, but it is for another PR to fix that. |
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.
Looks great, I have a few questions / suggestions.
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
...ruments/src/main/java/org/enso/interpreter/test/instruments/tck/EnsoTckLanguageProvider.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/BinaryOperatorNode.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/BinaryOperatorNode.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/node/MethodRootNode.java
Outdated
Show resolved
Hide resolved
val operators = ".!$%&*+-/<>?^~\\" | ||
def isOperator(n: Name): Boolean = { | ||
n.name | ||
.chars() | ||
.allMatch(operators.indexOf(_) >= 0) | ||
} |
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.
Later I will need to be able to check isOperator
also in the compiler at the type inference pass, so this should probably be somewhere reachable from both places.
But I'm happy to move it when the time comes, it seems OK to be here for now
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 wasn't sure what is a right place for such method. But yeah, right now I'd rather integrate then seek for the right method name.
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.
engine/runtime/src/test/java/org/enso/interpreter/test/ValuesGenerator.java
Show resolved
Hide resolved
engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala
Show resolved
Hide resolved
Benchmarks ( benchmark results, 2nd run) seem to be fine in general. If there is a regression, let's solve it individually after integrating. |
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
Run #4 failed in
|
Finally! |
Pull Request Description
Fixes #8346 by making sure binary operations like
+
,-
,/
,*
,%
accept any type as second argument under the assumption that the leftNumber
is convertible to the type of secondthat
argument via afrom
conversion.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
style guides
ThatConversionNode
when it runs out of specialization limit - done in 4f23530