summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t6336.check4
-rw-r--r--test/files/neg/t6336.scala11
-rw-r--r--test/files/run/empty-array.scala6
-rw-r--r--test/files/run/reflection-implicit.check2
-rw-r--r--test/files/run/reflection-implicit.scala15
5 files changed, 35 insertions, 3 deletions
diff --git a/test/files/neg/t6336.check b/test/files/neg/t6336.check
new file mode 100644
index 0000000000..f6b35ad232
--- /dev/null
+++ b/test/files/neg/t6336.check
@@ -0,0 +1,4 @@
+t6336.scala:3: error: Parameter type in structural refinement may not refer to a user-defined value class
+ val a = new { def y[T](x: X[T]) = x.i }
+ ^
+one error found
diff --git a/test/files/neg/t6336.scala b/test/files/neg/t6336.scala
new file mode 100644
index 0000000000..a9844ff94f
--- /dev/null
+++ b/test/files/neg/t6336.scala
@@ -0,0 +1,11 @@
+object D {
+ def main(args: Array[String]) {
+ val a = new { def y[T](x: X[T]) = x.i }
+ val x = new X(3)
+ val t = a.y(x)
+ println(t)
+ }
+}
+
+class X[T](val i: Int) extends AnyVal
+
diff --git a/test/files/run/empty-array.scala b/test/files/run/empty-array.scala
index e56c86df5c..6e37dca37d 100644
--- a/test/files/run/empty-array.scala
+++ b/test/files/run/empty-array.scala
@@ -1,8 +1,8 @@
object Test {
def main(args: Array[String]): Unit = {
- println(Byte.emptyArray.length)
- println(Double.emptyArray.length)
- println(Boolean.emptyArray.length)
+ println(Array.emptyByteArray.length)
+ println(Array.emptyDoubleArray.length)
+ println(Array.emptyBooleanArray.length)
// okay okay okay
}
}
diff --git a/test/files/run/reflection-implicit.check b/test/files/run/reflection-implicit.check
new file mode 100644
index 0000000000..bab1518c45
--- /dev/null
+++ b/test/files/run/reflection-implicit.check
@@ -0,0 +1,2 @@
+List(true, true, true, true)
+true
diff --git a/test/files/run/reflection-implicit.scala b/test/files/run/reflection-implicit.scala
new file mode 100644
index 0000000000..637ef24e14
--- /dev/null
+++ b/test/files/run/reflection-implicit.scala
@@ -0,0 +1,15 @@
+import scala.reflect.runtime.universe._
+
+class C {
+ implicit val v = new C
+ implicit def d(x: C)(implicit c: C): Int = ???
+ implicit class X(val x: Int)
+}
+
+object Test extends App {
+ val decls = typeOf[C].typeSymbol.typeSignature.declarations.sorted.toList.filter(sym => !sym.isTerm || (sym.isMethod && !sym.asMethod.isConstructor))
+ println(decls map (_.isImplicit))
+ val param = decls.find(_.name.toString == "d").get.asMethod.params.last.head
+ param.typeSignature
+ println(param.isImplicit)
+} \ No newline at end of file