Skip to content

Commit cd3b086

Browse files
committed
Fix -Ytest-pickler bug with private[this]
1 parent f1dcbbe commit cd3b086

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
157157
type This = OrderingConstraint
158158

159159
/** A new constraint with given maps and given set of hard typevars */
160-
def newConstraint( // !!! Dotty problem: Making newConstraint `private` causes -Ytest-pickler failure.
160+
private def newConstraint(
161161
boundsMap: ParamBounds = this.boundsMap,
162162
lowerMap: ParamOrdering = this.lowerMap,
163163
upperMap: ParamOrdering = this.upperMap,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ object Applications {
272272
else
273273
def selectGetter(qual: Tree): Tree =
274274
val getterDenot = qual.tpe.member(getterName)
275-
if (getterDenot.exists) qual.select(TermRef(qual.tpe, getterName, getterDenot))
275+
if (getterDenot.exists)
276+
getterDenot.asSymDenotation.isAccessibleFrom(qual.tpe.widenIfUnstable) // to reset Local
277+
qual.select(TermRef(qual.tpe, getterName, getterDenot))
276278
else EmptyTree
277279
if !meth.isClassConstructor then
278280
selectGetter(receiver)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Test:
2+
def callMeth(test: Test) = test.meth(-1)
3+
private def meth(foo: Int, bar: Int = 1) = foo + bar

0 commit comments

Comments
 (0)