From b45c69fb992acf1bbd9511408193d6d92ef7089a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 20 Jan 2015 22:25:09 +0100 Subject: Plugging a possible hole in unify unify now does a full `replace` of one parameter with the other. The previous scheme of just updating the entry of a parameter risks breaking constraint invariants. In particular, other constraint bounds can still refer to the eliminated parameter. This might not be a problem, but then we should be systeamtically leaving these references in everywhere. In any case it seems better to harmonize what unify and replace are doing. --- src/dotty/tools/dotc/core/TrackingConstraint.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools') diff --git a/src/dotty/tools/dotc/core/TrackingConstraint.scala b/src/dotty/tools/dotc/core/TrackingConstraint.scala index 5a77b88fc..37f4d5a6e 100644 --- a/src/dotty/tools/dotc/core/TrackingConstraint.scala +++ b/src/dotty/tools/dotc/core/TrackingConstraint.scala @@ -286,7 +286,7 @@ class TrackingConstraint(private val myMap: ParamInfo, def unify(p1: PolyParam, p2: PolyParam)(implicit ctx: Context): This = { val p1Bounds = (nonParamBounds(p1) & nonParamBounds(p2)).substParam(p2, p1) - this.updateEntry(p1, p1Bounds).updateEntry(p2, p1) + updateEntry(p1, p1Bounds).replace(p2, p1) } // ---------- Removals ------------------------------------------------------------ -- cgit v1.2.3