Skip to content

Commit 1489a06

Browse files
Blaisorbladenicolasstucki
authored andcommitted
Fix potential bug in IsDefinition
1 parent 457c812 commit 1489a06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ class TastyImpl(val rootContext: Contexts.Context) extends scala.tasty.Tasty wit
133133

134134
// ----- Definitions ----------------------------------------------
135135

136-
type Definition = tpd.Tree
136+
type Definition = tpd.Tree /* tpd.MemberDef | PackageDefinition */
137137

138138
object IsDefinition extends IsDefinitionExtractor {
139139
def unapply(tree: Tree)(implicit ctx: Context): Option[Definition] = tree match {
140140
case tree: tpd.MemberDef => Some(tree)
141+
case tree: PackageDefinition => Some(tree)
141142
case _ => None
142143
}
143144
}

0 commit comments

Comments
 (0)