summaryrefslogtreecommitdiff
path: root/test/files/pos/typealiases.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/typealiases.scala')
-rw-r--r--test/files/pos/typealiases.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/typealiases.scala b/test/files/pos/typealiases.scala
new file mode 100644
index 0000000000..c32a3e3a78
--- /dev/null
+++ b/test/files/pos/typealiases.scala
@@ -0,0 +1,20 @@
+package foo
+
+trait Test[T] {
+ type Check[T] = Array[T] => Unit;
+ type MyPair[S] = Pair[T, S]
+
+ val pair1: Pair[T, Int]
+ val pair: MyPair[Int] = pair1
+
+ def check(xs: Array[T], c: Check[T]) = c(xs)
+ def check2[S](xs: Array[S], c: Check[S]) = c(xs)
+}
+
+object main extends Test[Int] {
+ val pair1 = (1,1)
+
+ implicit def topair(x: Int): Pair[Int, Int] = (x,x)
+ val pair2: MyPair[Int] = 1
+ val x: short = 1
+} \ No newline at end of file