Skip to content

Commit bf6a4f8

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

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ object Applications {
272272
else
273273
def selectGetter(qual: Tree): Tree =
274274
val getterDenot = qual.tpe.member(getterName)
275+
.accessibleFrom(qual.tpe.widenIfUnstable) // to reset Local
275276
if (getterDenot.exists) qual.select(TermRef(qual.tpe, getterName, getterDenot))
276277
else EmptyTree
277278
if !meth.isClassConstructor then
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)