Skip to content

Commit 705f194

Browse files
committed
Test to close scala/bug#5075.
1 parent 9ba5196 commit 705f194

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/files/pos/t5075.scala

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
object BugReport {
2+
//Copied from Scalaz - http://scalaz.googlecode.com/svn/continuous/latest/browse.sxr/scalaz/PartialApplys.scala.html
3+
trait PartialApply1Of2[T[_, _], A] {
4+
type Apply[B] = T[A, B]
5+
6+
type Flip[B] = T[B, A]
7+
}
8+
9+
trait TypeWithHigherKindParam[D[_]]
10+
implicit def function[D[_]](t: TypeWithHigherKindParam[D]) = 1
11+
val param: TypeWithHigherKindParam[PartialApply1Of2[Tuple2, Int]#Apply] = null
12+
13+
function[PartialApply1Of2[Tuple2, Int]#Apply](param): Int //Compiles
14+
function(param) //Does not compile
15+
param: Int //Does not compile
16+
17+
//More complex variations of the same problem:
18+
//trait Exp[+T]
19+
20+
/*trait TypeWithHigherKindParam[D[_]]
21+
def function[D[_]](t: Exp[TypeWithHigherKindParam[D]]) = null
22+
val param: Exp[TypeWithHigherKindParam[PartialApply1Of2[Tuple2, Int]#Apply]] = null
23+
function[PartialApply1Of2[Tuple2, Int]#Apply](param)
24+
function(param)*/
25+
26+
/*
27+
trait TypeWithHigherKindParam[C[X] <: Traversable[X], D[_]]
28+
29+
def function[C[X], D[_]](t: Exp[TypeWithHigherKindParam[C,D]]) = null
30+
val param: Exp[TypeWithHigherKindParam[Traversable, PartialApply1Of2[Tuple2, Int]#Apply]] = null
31+
function[Traversable, PartialApply1Of2[Tuple2, Int]#Apply](param)
32+
function(param)
33+
*/
34+
}
35+
36+
// vim: set ts=4 sw=4 et:
37+

0 commit comments

Comments
 (0)