Skip to content

Fix #806 signature matching #812

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

Merged
merged 8 commits into from
Sep 30, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 29, 2015

So far a a partial PR, need to check some more things.

@DarkDimius
Copy link
Contributor

needs rebasing

Whenchecking whether two denotations match it is not enough
to look at the signatures. The signatures might match (on the
parameters) but the actual parametre types might be different.
The change always tests infos after signatures, effectively
turning the signature test into a pre-filter.
With the new approach to matching it is no longer sound.
We always have to match infos anyway to be sure.
When determining what to refine we should not rely only on signatures
but we need full denotation matching.
atSignature should also check result type names, except
 - if one of the result is a wildcard
 - a boolean flag relaxed is explicitly set
A test that checked for errors on overloading
now succeeds with the new rules.
@odersky odersky force-pushed the fix/#806-signature-matching branch from 740032b to 48a1f08 Compare September 29, 2015 17:19
@odersky
Copy link
Contributor Author

odersky commented Sep 29, 2015

rebased to master

When setting the denotation we did not change the checked period.
This can lead to a situation where a denotation is set to NoDenotation,
yet the checked period is something else. This means in effect the denotation
will vanish at the checked period. This bug caused the junit test failure
about "non-member exception" for sourceFile in DottyBackendInterface.
1) Matching after erasure also takes wildcards into account
(before it didn't).

2) Combine all signature matching operations into a single matchDegree method.
containsSig still used param-only matching, which is incorrect
in the new system, because different overloaded methods may have the
same parameter signature.
@odersky
Copy link
Contributor Author

odersky commented Sep 30, 2015

All done. Ready for review.

@DarkDimius
Copy link
Contributor

LGTM

DarkDimius added a commit that referenced this pull request Sep 30, 2015
@DarkDimius DarkDimius merged commit 3ae9347 into scala:master Sep 30, 2015
@allanrenucci allanrenucci deleted the fix/#806-signature-matching branch December 14, 2017 19:21
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.

4 participants