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

Extension method produces incorrect occurrence for qualifier #1780

Open
olafurpg opened this Issue Sep 25, 2018 · 1 comment

Comments

1 participant
@olafurpg
Copy link
Member

olafurpg commented Sep 25, 2018

// enrich.scala
object a {
  implicit class RichInt(x: Int) {
    def soRich(other: Int) = x + other
  }

  val op = 1
  op soRich 2
}

produces the following occurrences on the last line

- obtained
+ expected
- [6:2..6:4) => _empty_/a.RichInt().
+ [6:2..6:4) => _empty_/a.op.
[6:5..6:11) => _empty_/a.RichInt#soRich().

Reported by @jonas-db in https://gitter.im/scalameta/scalameta?at=5ba9ebf5cdc50131724cf9e5

@olafurpg

This comment has been minimized.

Copy link
Member

olafurpg commented Sep 25, 2018

Interestingly, the implicit conversion is recorded as a synthetic as well

Synthetics:
[6:2..6:4) => RichInt(*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment