Skip to content

Commit f40bb20

Browse files
committed
WIP widen 5
1 parent 910b581 commit f40bb20

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ class Typer extends Namer
20862086
/** Checks if one of the decls is a type with the same name as class type member in selfType */
20872087
def classExistsOnSelf(decls: Scope, self: tpd.ValDef): Boolean = {
20882088
val selfType = self.tpt.tpe
2089-
if (!selfType.exists || (selfType.classSymbol eq cls)) false
2089+
if (!selfType.exists || (selfType.widen.classSymbol eq cls)) false
20902090
else {
20912091
def memberInSelfButNotThis(decl: Symbol) =
20922092
selfType.member(decl.name).symbol.filter(other => other.isClass && other.owner != cls)

tests/neg/i6226.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ object O2 {
77
}
88

99
object O3 { // error
10-
opaque type R[X] = T[X]
10+
opaque type R[X] = T[X] // error
1111
opaque type T[X] = R[X] // error
1212
}

tests/neg/i8337.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ trait Foo[F <: Foo[F]]
22
class Bar extends Foo[Bar]
33

44
object Q { // error: recursion limit exceeded
5-
opaque type X <: Foo[X] = Bar // error: out of bounds
5+
opaque type X <: Foo[X] = Bar // error: out of bounds // error
66
}

0 commit comments

Comments
 (0)