Skip to content

Commit 7c121a8

Browse files
committed
Fix noInitMember to apply to DefDefs
Thanks for pointing it out, @smarter.
1 parent c395a25 commit 7c121a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] =>
2727
/** Does tree contain an initialization part when seen as a member of a class or trait?
2828
*/
2929
def isNoInitMember(tree: Tree): Boolean = unsplice(tree) match {
30-
case EmptyTree | Import(_, _) | TypeDef(_, _) => true
30+
case EmptyTree | Import(_, _) | TypeDef(_, _) | DefDef(_, _, _, _, _) => true
3131
case tree: ValDef => tree.unforcedRhs == EmptyTree
3232
case _ => false
3333
}

0 commit comments

Comments
 (0)