Skip to content

Add missing positions to trees created with TASTy reflect #5940

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

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki force-pushed the add-missing-positions-in-tasty-reflect-constructors branch from 53c301b to acefb73 Compare February 18, 2019 07:33
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Why Context => T instead of T, given that we do not change the context.

Otherwise, LGTM

@liufengyun
Copy link
Contributor

Confirmed that it works for #5796.

Copy link
Contributor Author

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

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

We change the context to ctx.withSource(rootPosition.source) in withDefaultPos

  protected def withDefaultPos[T <: Tree](fn: Context => T)(implicit ctx: Context): T = {
    fn(ctx.withSource(rootPosition.source)).withSpan(rootPosition.span)
  }

@liufengyun liufengyun merged commit f4d02de into scala:master Feb 18, 2019
@liufengyun liufengyun deleted the add-missing-positions-in-tasty-reflect-constructors branch February 18, 2019 10:24
liufengyun added a commit to dotty-staging/dotty that referenced this pull request Feb 18, 2019
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