You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API docs say that isPackage should imply isTerm, which makes sense. However, in 2.10-RC2, isPackage returns true for both packages and package classes, which are not terms.
Example repro code:
import scala.tools.nsc
val compiler = new nsc.Global(new nsc.Settings)
new compiler.Run
val sp = compiler.definitions.ScalaPackageClass
println("isPackageClass: " + sp.isPackageClass)
println("isPackage: " + sp.isPackage)
println("isTerm: " + sp.isTerm)
Something should give. In my opinion, the public API docs make more sense than the current behavior, so change the implementation. Have isPackage return false for package classes.
The text was updated successfully, but these errors were encountered:
@paulp said:
In my view packages and package classes (and modules and module classes) should never have made it into the public api; now that they're there, the distinction probably has to be maintained. But certainly isPackage{Class} and isModule{Class} should behave consistently with one another.
On the compiler side there is isModuleOrModuleClass. I thought there was an isPackageOrPackageClass, but I don't see it now.
Lex Spoon (lexspoon) said:
Great to see. I'm involved in writing queries against the reflection API, and inconsistencies like this can really suck away time.
The API docs say that isPackage should imply isTerm, which makes sense. However, in 2.10-RC2, isPackage returns true for both packages and package classes, which are not terms.
Example repro code:
This prints:
Something should give. In my opinion, the public API docs make more sense than the current behavior, so change the implementation. Have isPackage return false for package classes.
The text was updated successfully, but these errors were encountered: