-
Notifications
You must be signed in to change notification settings - Fork 326
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
Always try to resolve conversion for Any type #6184
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.
Looks good.
Maybe worth adding a few test cases for it?
I'd imagine at least 3:
- Have a conversion both on type
Foo
andAny
: verify that for an instance of typeFoo
the more specific one (Foo
, notAny
) is selected. - Have a conversion on
Any
but notFoo
- check thatAny
is selected - essentially what this PR does and is implicitly tested by the==
not breaking, but I think it's good to have an explicit test for it. - Have no conversion defined on neither
Foo
norAny
- to ensure that the conversion resolution error is still correctly reported.
There were fifteen failing tests in |
engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/UnresolvedConversion.java
Show resolved
Hide resolved
Sure, but these explicit tests would also serve as documentation on what is the behaviour we currently expect. |
There is a lot of tests in
That's "should be able to convert Any" test, I'd say.
There are two "should fail graciously..." tests that seem to cover this behavior. At the end I am just adding two tests for foreign Java object and a type: 40cc46b |
Running benchmarks for this PR. Manual comparison with |
Pull Request Description
Fixes #5898 by removing
Catch.panic
and speeding thesieve.enso
benchmark from 1058 ms to 514 ms. Should there be no dedicated conversion, let's use one defined onAny
type - e.g. defining a conversionfrom(Any)
makes such a conversion is always available.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Java,