Skip to content

Commit 89e65e9

Browse files
dwijnandKordyjan
authored andcommitted
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. [Cherry-picked e6012a0]
1 parent 4ce22d5 commit 89e65e9

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
@@ -669,7 +669,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
669669
&& !tree.isType
670670
&& !pt.isInstanceOf[ApplyingProto]
671671
&& !tree.tpe.match
672-
case tp: NamedType => tp.denot.hasAltWith(_.symbol.namedType.isStable)
672+
case tp: NamedType => tp.denot.hasAltWith(_.symbol.isStableMember && tp.prefix.isStable || tp.info.isStable)
673673
case tp => tp.isStable
674674
&& !isWildcardArg(tree)
675675
then

0 commit comments

Comments
 (0)