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

Support reading all sorts of refinement types. #216

Merged
merged 3 commits into from
Dec 1, 2022

Conversation

sjrd
Copy link
Contributor

@sjrd sjrd commented Dec 1, 2022

Including their members which can contain RECthis, METHODtype, and POLYtype.

Fix #6, fix #16, fix #20, fix #21.

This is not enough for #213 yet, since they are not handled correctly in member selection nor subtyping yet.

@sjrd sjrd requested a review from bishabosha December 1, 2022 12:29

// Read infos -- skip names
def readParamInfos()(using LocalContext): List[PInfo] =
paramInfosUnpickler.reader.until(end) {
Copy link
Member

Choose a reason for hiding this comment

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

this looks like it would try to readInfo when the next byte is the mods

Copy link
Member

@bishabosha bishabosha Dec 1, 2022

Choose a reason for hiding this comment

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

this example causes unexpected type tag GIVEN error (reading the inferred type of givenRefinement, stack trace includes TreeUnpickler.scala:1117):

// test-sources/src/main/scala/simple_trees/Function.scala
class Function {
 ...
  val givenRefinement = ??? : { def foo(using Int): Int }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh nice catch! It's fixed now.

Copy link
Member

@bishabosha bishabosha left a comment

Choose a reason for hiding this comment

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

there is a bug in reading the parameter infos of lambdas

Including their members which can contain RECthis, METHODtype, and
POLYtype.

Fix scalacenter#6, fix scalacenter#16, fix scalacenter#20, fix scalacenter#21.
@bishabosha bishabosha merged commit 669db31 into scalacenter:main Dec 1, 2022
@sjrd sjrd deleted the read-all-refinement-types branch December 1, 2022 23:22
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.

Support METHODtype Type Tag Support POLYtype Type Tag Support RECthis Type Tag Support term refinements
2 participants