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
[SemanticDB] Support TypeApply Synthetic #13481
Conversation
56c8e7b
to
130c511
Compare
@@ -3302,6 +3380,15 @@ Occurrences: | |||
[39:10..39:17): leftVar -> local3 | |||
[40:10..40:18): rightVar -> local4 | |||
|
|||
Synthetics: |
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.
Unlike scala2, we don't have [4:6..4:19): (left, right) => *.apply[Int, Int]
because actually we don't have it.
-Xprint:typer
shows:
before
val (left, right) = (1, 2)
after
private[this] val $1$: (Int, Int) = Tuple2.apply[Int, Int](1, 2)
val left: Int = this.$1$._1
val right: Int = this.$1$._2
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.
I didn't add synthesized Tuple2.apply[Int, Int](*)
to Synthetic section, because Scala2 doesn't include it (even though there is synthesized Tuple2.apply
)
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.
maybe something can be done here with tree attachments, this case only occurs when a pattern is exactly identifiers in a tuple:
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.
or at least the code linked above deals with all desugaring of patterns in val definitions so the door is open for other patterns than tuples
this needs a rebase |
What's the status of this PR? It needs a rebase but otherwise can it be merged @bishabosha ? |
I think it was just about improving support for Tuple patterns in a val definition, but that could be done in a later PR |
sorry i'd been busy and couldn't update it, I'll rebase onto master later. |
130c511
to
9b2ae02
Compare
I rebased and re-ran from sbt |
Ah, sorry for the late response, and thank you for rebasing (and of course reviewing)! |
#13135
This PR adds support Inferred Type Application to Synthetic. See https://scalameta.org/docs/semanticdb/specification.html#synthetic-1