CANVE / extractor

Extracts and normalizes the type relationships and call graph of scala sbt projects.
4 stars 1 forks source link

Arguments and parameters are not systematically captured #22

Open matanox opened 8 years ago

matanox commented 8 years ago

Run the plugin over:

class IsDeadCode {
  trait A {/* has a `def toString: String` inherited from scala.AnyRef */}
  class B extends A { override def toString = "B"}
  class C extends A { override def toString = "C" /* is this dead code? */ }

  def main(a: Array[String]): Unit = {

    def foo(a: A) = a.toString // does it call .toString on all the A’s?
    val b: B = new B;
    val c: C = new C;
     foo ( b )
  }
}

It is not being captured that:

Do we want to capture that information? (do we want to visualize that information?). We still capture the method call toString as is, so might this be seen as just an additional layer of information, which is not in and of itself necessary for what we try to visualize, and answer, for a user?