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
In Zinc meeting with Scala Center 2020-07-21 (@lrytz, @dwijnand, @sjrd, @eed3si9n), an idea came up today about informal hook for Class dependency tracking.
In addition (or instead) of Zinc injecting xsbt-dependency phase and try to figure out all instances of class dependencies, the idea is for the compiler to keep track of dependency information during the compilation as it happens, and Zinc can collect it afterwards. This is because we think it would be easier / more accurate if we keep track of dependency information as it happens, and for certain lookups it can only be observed in a certain phase.
Here are some of the example that may benefit from this approach..
This is an example @sjrd mentioned. Suppose x is coming from A.x:
objectTest {
importA._
{
importB._
println(x)
}
}
The compiler still tried to look up x from B._, which may be tracked. The idea is that if B later adds x it should trigger recompilation. (Is current name hashing able to catch this?)
publicenumDependencyContext {
/** * Represents a direct dependency between two symbols : * object Foo * object Bar { def foo = Foo } */DependencyByMemberRef,
/** * Represents an inheritance dependency between two symbols : * class A * class B extends A */DependencyByInheritance,
/** * Represents an inheritance dependency between a local class * and a non local class: * // A.scala * class A * // B.scala * class B { * def foo = { * class Local extends A * } * } */LocalDependencyByInheritance;
}
The text was updated successfully, but these errors were encountered:
In Zinc meeting with Scala Center 2020-07-21 (@lrytz, @dwijnand, @sjrd, @eed3si9n), an idea came up today about informal hook for Class dependency tracking.
In addition (or instead) of Zinc injecting xsbt-dependency phase and try to figure out all instances of class dependencies, the idea is for the compiler to keep track of dependency information during the compilation as it happens, and Zinc can collect it afterwards. This is because we think it would be easier / more accurate if we keep track of dependency information as it happens, and for certain lookups it can only be observed in a certain phase.
Here are some of the example that may benefit from this approach..
SAM type inference
sbt/zinc#830
Wildcard import
This is an example @sjrd mentioned. Suppose
x
is coming fromA.x
:The compiler still tried to look up
x
fromB._
, which may be tracked. The idea is that ifB
later addsx
it should trigger recompilation. (Is current name hashing able to catch this?)Dependency
Here is the current implementation of https://github.com/sbt/zinc/blob/v1.4.0-M6/internal/compiler-bridge/src/main/scala/xsbt/Dependency.scala
3 callback called into Zinc are:
where context is defined by
The text was updated successfully, but these errors were encountered: