Skip to content

Commit 6afb659

Browse files
committed
add crash diagnostics in ExtractDependencies
1 parent 1994d6c commit 6afb659

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ private class ExtractDependenciesCollector extends tpd.TreeTraverser { thisTreeT
335335
/** Traverse the tree of a source file and record the dependencies and used names which
336336
* can be retrieved using `dependencies` and`usedNames`.
337337
*/
338-
override def traverse(tree: Tree)(implicit ctx: Context): Unit = {
338+
override def traverse(tree: Tree)(implicit ctx: Context): Unit = try {
339339
tree match {
340340
case Match(selector, _) =>
341341
addPatMatDependency(selector.tpe)
@@ -384,6 +384,10 @@ private class ExtractDependenciesCollector extends tpd.TreeTraverser { thisTreeT
384384
case _ =>
385385
traverseChildren(tree)
386386
}
387+
} catch {
388+
case ex: AssertionError =>
389+
println(i"asserted failed while traversing $tree")
390+
throw ex
387391
}
388392

389393
/** Traverse a used type and record all the dependencies we need to keep track

0 commit comments

Comments
 (0)