Skip to content

Commit e6012a0

Browse files
committed
Refine how we check for stability
In particular, must continue to use the type's prefix, rather than the denotation's prefix. That way, e.g. in tests/neg/i3812b.scala, referencing value class'\''s value, will fail on the non-stable value class prefix, rather than the denotation'\''s prefix, which is NoSymbol.
1 parent 85d656a commit e6012a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
674674
&& !tree.isType
675675
&& !pt.isInstanceOf[ApplyingProto]
676676
&& !tree.tpe.match
677-
case tp: NamedType => tp.denot.hasAltWith(_.symbol.namedType.isStable)
677+
case tp: NamedType => tp.denot.hasAltWith(_.symbol.isStableMember && tp.prefix.isStable || tp.info.isStable)
678678
case tp => tp.isStable
679679
&& !isWildcardArg(tree)
680680
then

0 commit comments

Comments
 (0)