Skip to content

Commit

Permalink
Refine how we check for stability
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dwijnand committed Aug 2, 2023
1 parent 85d656a commit e6012a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
&& !tree.isType
&& !pt.isInstanceOf[ApplyingProto]
&& !tree.tpe.match
case tp: NamedType => tp.denot.hasAltWith(_.symbol.namedType.isStable)
case tp: NamedType => tp.denot.hasAltWith(_.symbol.isStableMember && tp.prefix.isStable || tp.info.isStable)
case tp => tp.isStable
&& !isWildcardArg(tree)
then
Expand Down

0 comments on commit e6012a0

Please sign in to comment.