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 #15582

Merged
merged 1 commit into from
May 23, 2022

Conversation

somdoron
Copy link
Contributor

@somdoron somdoron commented May 21, 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]]
}

@stuhood stuhood added the category:bugfix Bug fixes for released features label May 23, 2022
Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!

@stuhood stuhood changed the title record package object as provided name Record Scala package object as provided name May 23, 2022
@stuhood stuhood enabled auto-merge (squash) May 23, 2022 17:27
@stuhood stuhood added this to the 2.12.x milestone May 23, 2022
@stuhood stuhood merged commit e94448d into pantsbuild:main May 23, 2022
stuhood pushed a commit to stuhood/pants that referenced this pull request 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]]
}
```

# 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 added a commit that referenced this pull request May 23, 2022
#15608)

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]]
}
```

[ci skip-rust]
[ci skip-build-wheels]

Co-authored-by: Doron Somech <[email protected]>
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.

2 participants