Skip to content

Commit 7859527

Browse files
committed
Drop ineffective condition
The dropped condition is vacuously true for all singleton prefixes, since for them classSymbol is NoSymbol. If we make it work as was intended using widen in front of classSymbol on both sides, then EeraseAnd and dotty bootstrap fail.
1 parent be25f43 commit 7859527

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ object Types {
23782378
/** A reference like this one, but with the given prefix. */
23792379
final def withPrefix(prefix: Type)(using Context): NamedType = {
23802380
def reload(): NamedType = {
2381-
val allowPrivate = !lastSymbol.exists || lastSymbol.is(Private) && prefix.classSymbol == this.prefix.classSymbol
2381+
val allowPrivate = !lastSymbol.exists || lastSymbol.is(Private)
23822382
var d = memberDenot(prefix, name, allowPrivate)
23832383
if (d.isOverloaded && lastSymbol.exists)
23842384
d = disambiguate(d,

0 commit comments

Comments
 (0)