mirror of https://github.com/sbt/sbt.git
Check for null type trees in dependency extraction
In some cases the dependency extraction may encounter a null `TypeTree` (eg. arguments of macro annotations that are untyped). In such cases, we simply ignore the node. Fixes #1593, #1655.
This commit is contained in:
parent
d47d0b1463
commit
18c521dd4b
|
|
@ -137,7 +137,9 @@ final class Dependency(val global: CallbackGlobal) extends LocateClassFile {
|
|||
*/
|
||||
case ident: Ident =>
|
||||
addDependency(ident.symbol)
|
||||
case typeTree: TypeTree =>
|
||||
// In some cases (eg. macro annotations), `typeTree.tpe` may be null.
|
||||
// See sbt/sbt#1593 and sbt/sbt#1655.
|
||||
case typeTree: TypeTree if typeTree.tpe != null =>
|
||||
val typeSymbolCollector = new CollectTypeTraverser({
|
||||
case tpe if !tpe.typeSymbol.isPackage => tpe.typeSymbol
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue