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

Record Scala package object as provided name (Cherry-pick of #15582) #15608

Merged
merged 1 commit into from May 23, 2022

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented May 23, 2022

The package object should also be recorded as provided name, as it also behaves as an object.

An example that will fail without this fix:

File t.scala:

package object example {
   trait T[A]
}

File a.scala:

package example

package object a {
   implicit val tString: T[String] = new T[String] {}
}

File b.scala:

package example.b

import example.T
import example.a._

object B {
   val x = implicitly[T[String]]
}

The package object should also be recorded as provided name, as it also behaves as an object. 

An example that will fail without this fix:

File t.scala:
```
package object example {
   trait T[A]
}
```

File a.scala:
```
package example

package object a {
   implicit val tString: T[String] = new T[String] {}
}
```

File b.scala:
```
package example.b

import example.T
import example.a._

object B {
   val x = implicitly[T[String]]
}
```

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@stuhood stuhood added the category:bugfix Bug fixes for released features label May 23, 2022
@stuhood stuhood merged commit a74eadb into pantsbuild:2.12.x May 23, 2022
@stuhood stuhood deleted the cherry-pick-15582-to-2.12.x branch May 23, 2022 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants