Skip to content

Commit

Permalink
ExtractDependencies: correctly record inheritance on type alias
Browse files Browse the repository at this point in the history
This fix the test "Extracted source dependencies from public members"
which previously failed with:
  Set('G, 'E) is not equal to Set('B, 'E) (DependencySpecification.scala:34)

`H` extends `G.T[Int]` which is an alias of `B`, so the
`topLevelInheritanceDepndencies` of `H` should contain `B`, this was not
the case before because we didn't dealias before looking for the
top-level class of the dependency, so we ended up with `G`, the
top-level class in which the alias `T` is contained.
  • Loading branch information
smarter committed Nov 22, 2016
1 parent 3693211 commit 2d6a290
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private class ExtractDependenciesCollector(implicit val ctx: Context) extends tp
addDependency(ref.symbol)
usedTypeTraverser.traverse(ref.tpe)
case t @ Template(_, parents, _, _) =>
t.parents.foreach(p => addInheritanceDependency(p.tpe.typeSymbol))
t.parents.foreach(p => addInheritanceDependency(p.tpe.classSymbol))
case _ =>
}
traverseChildren(tree)
Expand Down

0 comments on commit 2d6a290

Please sign in to comment.