Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,7 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
checkNotPackage(tree)
else
registerNeedsInlining(tree)
val tree1 = checkUsableAsValue(tree)
tree1.tpe match {
case tpe: ThisType => This(tpe.cls).withSpan(tree.span)
case _ => tree1
}
checkUsableAsValue(tree)
case tree @ Select(qual, name) =>
registerNeedsInlining(tree)
if name.isTypeName then
Expand Down
3 changes: 3 additions & 0 deletions tests/run/i23875.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
true
false
false
11 changes: 11 additions & 0 deletions tests/run/i23875.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
object Foo {
override def equals(that : Any) = that match {
case _: this.type => true
case _ => false
}
}

@main def Test =
println(Foo.equals(Foo))
println(Foo.equals(new AnyRef {}))
println(Foo.equals(0))
Loading