Skip to content

Commit 408aa74

Browse files
committed
Fix pickling issue
1 parent 3ac5cec commit 408aa74

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ object desugar {
12281228
val PolyFunction(tparams: List[untpd.TypeDef] @unchecked, fun @ Function(vparamTypes, res)) = tree: @unchecked
12291229
val newTParams = tparams.mapConserve {
12301230
case td @ TypeDef(name, cb @ ContextBounds(bounds, ctxBounds)) =>
1231-
TypeDef(name, ContextBounds(bounds, List.empty))
1231+
cpy.TypeDef(td)(name, bounds)
12321232
case t => t
12331233
}
12341234
var idx = 0

tests/pos/contextbounds-for-poly-functions.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import scala.language.future
55
trait Ord[X]:
66
def compare(x: X, y: X): Int
77

8-
// val less1 = [X: Ord] => (x: X, y: X) => summon[Ord[X]].compare(x, y) < 0
8+
val less1 = [X: Ord] => (x: X, y: X) => summon[Ord[X]].compare(x, y) < 0
99

10-
// val less2 = [X: Ord as ord] => (x: X, y: X) => ord.compare(x, y) < 0
10+
val less2 = [X: Ord as ord] => (x: X, y: X) => ord.compare(x, y) < 0
1111

12+
type CtxFunctionRef = Ord[Int] ?=> Boolean
1213
type ComparerRef = [X] => (x: X, y: X) => Ord[X] ?=> Boolean
1314
type Comparer = [X: Ord] => (x: X, y: X) => Boolean
1415
val less3: Comparer = [X: Ord as ord] => (x: X, y: X) => ord.compare(x, y) < 0

0 commit comments

Comments
 (0)