Skip to content

Commit 134964f

Browse files
committed
Enable pickling test
Avoid unnecessary recursive types in the presence of LazyRef.
1 parent c630d5a commit 134964f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,7 +2924,7 @@ object Types {
29242924
tp match {
29252925
case tp: TypeRef => apply(x, tp.prefix)
29262926
case tp: RecThis => RecType.this eq tp.binder
2927-
case tp: LazyRef => true // To be safe, assume a reference exists
2927+
case tp: LazyRef => this(x, tp.ref)
29282928
case _ => foldOver(x, tp)
29292929
}
29302930
}
@@ -5729,7 +5729,8 @@ object Types {
57295729
def apply(exists: Boolean, tp: Type): Boolean =
57305730
exists || tp.match {
57315731
case tp: NamedType =>
5732-
this(false, tp.prefix)
5732+
// a method param is non-local in avoidance
5733+
!tp.symbol.is(Param) && this(false, tp.prefix)
57335734
case NoPrefix =>
57345735
true
57355736
case tp: AppliedType =>

compiler/test/dotc/pos-test-pickling.blacklist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,3 @@ i9793.scala
6060

6161
# lazy_implicit symbol has different position after pickling
6262
i8182.scala
63-
64-
# trivial recursive type gets stripped
65-
i11464.scala

0 commit comments

Comments
 (0)