From 6f42bd6881f9b1a6fa25d744cded38f53058538c Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 8 Dec 2013 22:37:38 +0100 Subject: SI-8046 Only use fast TypeRef#baseTypeSeq with concrete base types We can only compute the base type sequence (BTS) of a `TypeRef` by element-wise transforming the BTS of the referenced symbol if there are no abstract types in its BTS type symbols. In the now-working test case, `pos/t8046.scala`, the difference between the old and new calculation of the BTS is: this = Three.this.Alias[Int] sym.info.baseTypeSeq = BTS(One.this.Op[A],Any) mapped BTS = BTS(Three.this.Op[Int],Any) full BTS = BTS(Three.this.Op[Int],Int => Int,Object,Any) The change to account for PolyType in ArgsTypeRef#transform is now needed to avoid the full BTS of: BTS(Three.this.Op[A],A => A,Object,Any) Interestingly, everything actually works without that change. --- test/pending/pos/t8046c.scala | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 test/pending/pos/t8046c.scala (limited to 'test/pending') diff --git a/test/pending/pos/t8046c.scala b/test/pending/pos/t8046c.scala deleted file mode 100644 index 9a8616828d..0000000000 --- a/test/pending/pos/t8046c.scala +++ /dev/null @@ -1,19 +0,0 @@ -trait One { - type Op[A] - type Alias[A] = Op[A] -} - -trait Three extends One { - trait Op[A] extends (A => A) - - def f1(f: Op[Int]) = f(5) - def f2(f: Alias[Int]) = f(5) - def f3[T <: Op[Int]](f: T) = f(5) - def f4[T <: Alias[Int]](f: T) = f(5) - // ./a.scala:12: error: type mismatch; - // found : Int(5) - // required: T1 - // def f4[T <: Alias[Int]](f: T) = f(5) - // ^ -} - -- cgit v1.2.3