Skip to content

non-private method referring to private type is overeager #2678

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

Closed
rkuhn opened this issue Jun 4, 2017 · 6 comments
Closed

non-private method referring to private type is overeager #2678

rkuhn opened this issue Jun 4, 2017 · 6 comments

Comments

@rkuhn
Copy link

rkuhn commented Jun 4, 2017

[error] non-private method doCollected refers to private trait Collected
[error]  in its type signature [org$scalatest$Matchers$doCollected$$T]
[error]   (collected: Matchers.this.Collected, xs: scala.collection.GenTraversable[T], 
[error]     original
[error]   : Any, prettifier: org.scalactic.Prettifier, pos: 
[error]     org.scalactic.source.Position
[error]   )(fun: T => org.scalatest.Assertion)org.scalatest.Assertion
[error] one error found

Looking at the Scalatest source, doCollected is private[scalatest], which means that compiling my own project against this code should not result in an error—I can see why it should be an error when building scalatest itself, though.

@odersky
Copy link
Contributor

odersky commented Jan 22, 2018

Qualified private simply does not figure in privacy testing. So I am not sure we can do something here.

@odersky odersky closed this as completed Jan 22, 2018
@smarter
Copy link
Member

smarter commented Jan 22, 2018

When unpickling from Scala 2, we could simply silence errors from checkNoPrivateLeaks by default.

@kelebra
Copy link

kelebra commented Mar 17, 2018

This issue looks like a show-stopper for using scalatest with dotty. Reproduces for both scalatest 3.0.5 and 3.2.0-SNAP10 and latest dotty on tiny project.

@odersky
Copy link
Contributor

odersky commented Mar 17, 2018

I think we no longer need to check private leaks when unpickling. We needed that before, when all references were based on names, but that's no longer the case.

@odersky odersky reopened this Mar 17, 2018
smarter referenced this issue Mar 29, 2018
Disable checkNoPrivateLeaks when unpickling
@smarter
Copy link
Member

smarter commented Apr 12, 2018

Should be fixed by #4133, let us know if you find more problems using scalatest with dotty.

@smarter smarter closed this as completed Apr 12, 2018
@rkuhn
Copy link
Author

rkuhn commented Apr 12, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants