From 2d6a290d93e9a4e58cda443b93cd126ebee43be8 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Thu, 13 Oct 2016 17:58:59 +0200 Subject: ExtractDependencies: correctly record inheritance on type alias 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. --- compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/src/dotty/tools/dotc/sbt') diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index 229e35360..fefa63f6f 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -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) -- cgit v1.2.3