From 84442a01cec37e3f96e330b7e0167a9ef387e8c8 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Wed, 29 Jun 2011 10:27:41 +0000 Subject: slight improvement to lubList so that the simpl... slight improvement to lubList so that the simple case of lubbing type constructors works. review by extempore the strategy is to detect when the ts in lub(ts) are actually type constructors and remember their type parameters the BTS of a type constructor is a list of proper types (the type constructors have been applied to their dummy arguments, which are simply type refs to the original type parameters) in lubList, we undo this damage by stripping these dummy arguments (they refer to type parameters that are meant to be bound) a better fix would be to actually bind those type parameters that appear free in error, but that would require major changes to the BTS infrastructure example that only kindasorta works now... given: trait Container[+T] trait Template[+CC[X] <: Container[X]] class C1[T] extends Template[Container] with Container[T] C1's BTS contains Template[Container] with Container[T], but that should really be [T] => Template[Container] with Container[T] instead of wrapping it in a polytype, the current approach uses elimHOTparams to patch up this type so that it looks more like a type ctor: Template[Container] with Container, but this is ill-kinded as Template[Container] is a proper type, whereas Container is not the performance impact should be minimal, but caveat reviewer --- test/files/pos/hklub0.scala | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/files/pos/hklub0.scala (limited to 'test') diff --git a/test/files/pos/hklub0.scala b/test/files/pos/hklub0.scala new file mode 100644 index 0000000000..8f68aab4ea --- /dev/null +++ b/test/files/pos/hklub0.scala @@ -0,0 +1,5 @@ +object Test { + val a : scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq] = null + val b : scala.collection.generic.GenericCompanion[scala.collection.mutable.Seq] = null + List(a, b) // immutable.this.List.apply[scala.collection.generic.GenericCompanion[Seq]](Test.this.a, Test.this.b) +} \ No newline at end of file -- cgit v1.2.3