Skip to content
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

Simplify usage of tasty-query and make things more precise. #6

Merged
merged 14 commits into from
Nov 6, 2023

Conversation

sjrd
Copy link

@sjrd sjrd commented Nov 3, 2023

This is a series of refactorings I found by looking at how tasty-query was used, and how to make its usage more precise/semantic.

Take what you want ;)

sjrd added 14 commits November 3, 2023 10:29
And by explicitly following owners one at a time, instead of
converting the whole signature name into a string and then doing
regex-based decomposition.

The signature name is a particular (lossy) encoding of the
class/array decomposition of `ErasedTypeRef`, and of the
owner/name chain of `ClassSymbol`s. We now directly look at that
original information instead of recovering part of that information
from the signature name encoding.
…ctor.

That is their only source. In general, it makes no sense to erase
a wildcard. It only makes sense in that particular place because
the compiler later turns those type arguments into actual arguments
and result types, where it picks their upper bound.
Previously, `matchSignature1` had 3 completely separate code paths
for `java.lang.Enum` constructors, curried context functions, and
other methods.

We now limit the separate code paths to identifying the types of
"expanded" parameters. Then, the actual matching is done in a
unique way.
There are three categories of matching that each performed the
same surrounding computations at all call sites. We now factor
them out.
Instead of our extension `declaredTypeAsSeenFrom`.
Previously, the code attempted to compare a string to `"void"`,
but even if it were `Unit`, the returned string would be
`"scala.Unit"`, defeating the purpose of the test.

We now semantically compare the `ErasedTypeRef`.

This does not appear to change anything in our tests, however.
Copy link
Owner

@adpi2 adpi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@adpi2 adpi2 merged commit d517748 into adpi2:better-stack-trace Nov 6, 2023
5 of 9 checks passed
@sjrd sjrd deleted the simplify-tasty-query-usage branch November 6, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants