mysterious-waiter-14207
06/12/2022, 7:16 PMobject
always be treated as recursive provided type, like jvm_artifact? The reason for this, object
in scala can extend another object
, Pants' Scala Parser has no way to know that object is providing more types than the actual code in it.witty-crayon-22786
06/13/2022, 6:08 PMobject
, it needs to be imported, right? in that case, it should already be detected as a dependency of the file, which makes it available to consumerswitty-crayon-22786
06/13/2022, 6:10 PMmysterious-waiter-14207
06/13/2022, 7:54 PMmysterious-waiter-14207
06/13/2022, 7:56 PMobject A {
def a(x: Int): Int = ???
}
File B:
import A
object B extends A {
}
File Main:
import B.a
def main() = println(a(5))
the above won't compile at the moment, because pants scala-parser cannot find the symbol B.a
witty-crayon-22786
06/13/2022, 8:16 PMwitty-crayon-22786
06/13/2022, 8:19 PMB.a
and B
when it encounters B.a
witty-crayon-22786
06/13/2022, 8:29 PMclass
or object
declare themselves as recursive probably makes sense? they own that namespace.
but that seems quite similar to not having symbol level awareness… Java doesn’t currently: https://github.com/pantsbuild/pants/issues/13765 . i’d need to page back in why we felt that symbol level awareness was necessary in the first place.mysterious-waiter-14207
06/13/2022, 8:34 PMmysterious-waiter-14207
06/17/2022, 6:28 PM