Skip to content

Commit 199dca7

Browse files
committed
Harden definition of isScalaTrait
Exclude false positives such as `Lambda|` be requiring that lambda traits are defined in the Scala package.
1 parent d53da95 commit 199dca7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ object SymDenotations {
446446

447447
/** is this symbol a trait representing a type lambda? */
448448
final def isLambdaTrait(implicit ctx: Context): Boolean =
449-
isClass && name.startsWith(tpnme.LambdaPrefix)
449+
isClass && name.startsWith(tpnme.LambdaPrefix) && owner == defn.ScalaPackageClass
450450

451451
/** Is this symbol a package object or its module class? */
452452
def isPackageObject(implicit ctx: Context): Boolean = {

0 commit comments

Comments
 (0)