Skip to content

Commit f5da246

Browse files
committed
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.
1 parent 8ae9694 commit f5da246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ private class ExtractDependenciesCollector(implicit val ctx: Context) extends tp
200200
addDependency(ref.symbol)
201201
usedTypeTraverser.traverse(ref.tpe)
202202
case t @ Template(_, parents, _, _) =>
203-
t.parents.foreach(p => addInheritanceDependency(p.tpe.typeSymbol))
203+
t.parents.foreach(p => addInheritanceDependency(p.tpe.classSymbol))
204204
case _ =>
205205
}
206206
traverseChildren(tree)

0 commit comments

Comments
 (0)