Skip to content

sbt.ExtractAPI: Support TypeArgRef #3280

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 1 commit into from
Oct 7, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Oct 6, 2017

TypeArgRef can leak to method signatures, therefore it needs to be
handled in ExtractAPI for incremental compilation to work correctly.

@odersky : See sbt-dotty/sbt-test/source-dependencies/typeargref/A.scala for an example where a TypeArgRef leaks to the signature. This example seems dubious to me since there's no reason we couldn't use the underlying type here, so let me know if you can come up with a more reasonable example.

@smarter smarter requested a review from odersky October 6, 2017 16:56
@smarter smarter force-pushed the sbt-extract-typeargref branch from eaa4594 to ecdb624 Compare October 6, 2017 16:57
TypeArgRef can leak to method signatures, therefore it needs to be
handled in ExtractAPI for incremental compilation to work correctly.
@smarter smarter force-pushed the sbt-extract-typeargref branch from ecdb624 to 0b565cb Compare October 6, 2017 16:58
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I don't really know how this is supposed to work, but assume it's the right thing.

@@ -343,6 +344,12 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
}
}

// Hack to represent dotty types which don't have an equivalent in xsbti
def combineApiTypes(apiTps: api.Type*): api.Type = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I have no idea what this is supposed to achieve.

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically fitting a square peg in a round hole: sbt has its own representation of types which doesn't include anything like TypeArgRef, but we can still get incremental compilation to work correctly if we can find a bijection between dotty's types and sbt's types, since the only thing that matter is that the hash of the sbt type changes when the dotty type changes. Don't worry too much about it :).

@smarter smarter merged commit d52f98c into scala:master Oct 7, 2017
@allanrenucci allanrenucci deleted the sbt-extract-typeargref branch December 14, 2017 19:24
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