Skip to content

Commit 2e1f78b

Browse files
committed
Merge pull request scala#4748 from VladUreche/issue/9475
SI-9475 Dependent PolyTypes are dependent types
2 parents 224efeb + fe45005 commit 2e1f78b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/reflect/scala/reflect/internal/Types.scala

+3
Original file line numberDiff line numberDiff line change
@@ -2510,6 +2510,9 @@ trait Types
25102510
override def baseType(clazz: Symbol): Type = resultType.baseType(clazz)
25112511
override def narrow: Type = resultType.narrow
25122512

2513+
// SI-9475: PolyTypes with dependent method types are still dependent
2514+
override def isDependentMethodType = resultType.isDependentMethodType
2515+
25132516
/** @M: typeDefSig wraps a TypeBounds in a PolyType
25142517
* to represent a higher-kinded type parameter
25152518
* wrap lo&hi in polytypes to bind variables

test/files/pos/t9475.scala

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
trait Ctx {
2+
trait Tree
3+
}
4+
5+
trait Lst[+A] {
6+
def zip[A1 >: A, B](that: Lst[B]): Nothing
7+
}
8+
9+
object Test {
10+
11+
// both of these methods should be transformed by uncurry
12+
// such that List[c.Tree] becomes List[Ctx#Tree]:
13+
def foo1(c: Ctx)(l: Lst[c.Tree]) = l zip l
14+
def foo2[@specialized T](c: Ctx)(l: Lst[c.Tree], t: T) = l zip l
15+
16+
// if this doesn't happen for the 2nd method, the specialization
17+
// transformation fails
18+
}
19+

0 commit comments

Comments
 (0)