From 9f4c747c6d1bd866aead90d74ab56cfceb877f6e Mon Sep 17 00:00:00 2001 From: Aleksandar Pokopec Date: Wed, 16 Feb 2011 12:29:05 +0000 Subject: Fix in the unify, for a failing specialized test. No review. --- src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 632d3787c9..ceeac9d5a5 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -960,9 +960,10 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { else if (strict) throw UnifyError else env case (TypeRef(_, sym1, args1), TypeRef(_, sym2, args2)) => + log("Unify - both type refs: " + tp1 + " and " + tp2 + " with args " + (args1, args2) + " - ") if (strict && args1.length != args2.length) throw UnifyError val e = unify(args1, args2, env, strict) - log("Unify - both type refs: " + tp1 + " and " + tp2 + " with args " + (args1, args2) + " - " + e) + log("unified to: " + e) e case (TypeRef(_, sym1, _), _) if sym1.isTypeParameterOrSkolem => env @@ -995,8 +996,11 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { if (!strict) unify(args._1, args._2, env, strict) else { val nenv = unify(args._1, args._2, emptyEnv, strict) - if (env.keySet.intersect(nenv.keySet) == emptyEnv) env ++ nenv - else throw UnifyError + if (env.keySet.intersect(nenv.keySet) == Set()) env ++ nenv + else { + log("could not unify: u(" + args._1 + ", " + args._2 + ") yields " + nenv + ", env: " + env) + throw UnifyError + } } } -- cgit v1.2.3