Open eatkins opened 5 years ago
I'm an unclear on why this should be a separate ticket from #10313?
The other example from the other ticket:
scala> object X { private class Y ; class Z extends Y }
^
error: private class Y escapes its defining scope as part of type X.Y
scala> object X { private class Y ; private type YY = Y ; class Z extends YY }
defined object X
I don't know if it's the same symptom. I see YY
is unused after uncurry.
Edit: the other ticket was arguably about interaction with macros, but a better mechanism would probably address both bugs.
I see that @som-snytt already chimed in, but it was his suggestion at the bottom of #10313 that prompted my opening this issue. I have run into the issue multiple times in sbt which has both -Xfatal-warnings and -Ywarn-unused:-private set. I'd have no problem with unifying the two issues either in #10313 itself or a new issue.
The following code will generate the error "private type Alias in object Foo is never used" in scala 2.12.8:
This issue also came up in the example provided by @varming in the discussion of https://github.com/scala/bug/issues/10313.