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
5 changes: 3 additions & 2 deletions compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ object SymDenotations {
val enclClassInfo = owner.asClass.classInfo
enclClassInfo.selfInfo match {
case self: Type =>
owner.info = enclClassInfo.derivedClassInfo(selfInfo = refineSelfType(self))
owner.info = enclClassInfo.derivedClassInfo(
selfInfo = refineSelfType(self.orElse(defn.AnyType)))
case self: Symbol =>
self.info = refineSelfType(self.info)
}
Expand Down Expand Up @@ -1177,7 +1178,7 @@ object SymDenotations {
case _ =>
NoType
}
recur(owner.asClass.classInfo.selfType)
recur(owner.asClass.givenSelfType)
}

/** The non-private symbol whose name and type matches the type of this symbol
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ class TreePickler(pickler: TastyPickler) {
pickleParams(params)
tree.parents.foreach(pickleTree)
val cinfo @ ClassInfo(_, _, _, _, selfInfo) = tree.symbol.owner.info
if ((selfInfo ne NoType) || !tree.self.isEmpty) {
if (!tree.self.isEmpty) {
writeByte(SELFDEF)
pickleName(tree.self.name)

Expand Down
3 changes: 3 additions & 0 deletions tests/pos/i6822.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class C {
opaque type T = Int
}