Skip to content

Commit 23f0e6d

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 ff7e3b0 commit 23f0e6d

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
@@ -2376,7 +2376,7 @@ object Types {
23762376
/** A reference like this one, but with the given prefix. */
23772377
final def withPrefix(prefix: Type)(using Context): NamedType = {
23782378
def reload(): NamedType = {
2379-
val allowPrivate = !lastSymbol.exists || lastSymbol.is(Private) && prefix.classSymbol == this.prefix.classSymbol
2379+
val allowPrivate = !lastSymbol.exists || lastSymbol.is(Private)
23802380
var d = memberDenot(prefix, name, allowPrivate)
23812381
if (d.isOverloaded && lastSymbol.exists)
23822382
d = disambiguate(d,

0 commit comments

Comments
 (0)