From 54df3c451cb58d77a6dfe5e4114b51b8eedc5c57 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 26 Feb 2008 10:53:33 +0000 Subject: fixed #519 --- src/compiler/scala/tools/nsc/typechecker/Infer.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 3fc3e30585..bbae1daf7a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -232,7 +232,12 @@ trait Infer { // todo: use also for other error messages private def existentialContext(tp: Type) = tp.existentialSkolems match { case List() => "" - case skolems => " where "+(skolems map (_.existentialToString) mkString ", ") + case skolems => + def disambiguate(ss: List[String]) = ss match { + case List() => ss + case s :: ss1 => s :: (ss1 map (s1 => if (s1 == s) "(some other)"+s1 else s1)) + } + " where "+(disambiguate(skolems map (_.existentialToString)) mkString ", ") } def foundReqMsg(found: Type, req: Type): String = -- cgit v1.2.3