diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t8072.check | 4 | ||||
-rw-r--r-- | test/files/neg/t8072.scala | 6 | ||||
-rw-r--r-- | test/files/neg/warn-unused-imports.check | 13 | ||||
-rw-r--r-- | test/files/neg/warn-unused-imports.flags | 2 | ||||
-rw-r--r-- | test/files/neg/warn-unused-privates.flags | 2 | ||||
-rw-r--r-- | test/files/pos/t5165b/TestAnnotation_1.java | 11 | ||||
-rw-r--r-- | test/files/pos/t5165b/TestObject_3.scala | 3 | ||||
-rw-r--r-- | test/files/pos/t5165b/TestTrait_2.scala | 3 | ||||
-rw-r--r-- | test/files/run/t5134.scala | 8 | ||||
-rw-r--r-- | test/files/run/t5565.scala | 12 | ||||
-rw-r--r-- | test/files/run/t7932.check | 3 | ||||
-rw-r--r-- | test/files/run/t7932.scala | 11 |
12 files changed, 64 insertions, 14 deletions
diff --git a/test/files/neg/t8072.check b/test/files/neg/t8072.check new file mode 100644 index 0000000000..9267010135 --- /dev/null +++ b/test/files/neg/t8072.check @@ -0,0 +1,4 @@ +t8072.scala:4: error: value ifParSeq is not a member of List[Int] + val y = x.ifParSeq[Int](throw new Exception).otherwise(0) // Shouldn't compile + ^ +one error found diff --git a/test/files/neg/t8072.scala b/test/files/neg/t8072.scala new file mode 100644 index 0000000000..2c8213e34a --- /dev/null +++ b/test/files/neg/t8072.scala @@ -0,0 +1,6 @@ +class NoIfParSeq { + import collection.parallel._ + val x = List(1,2) + val y = x.ifParSeq[Int](throw new Exception).otherwise(0) // Shouldn't compile + val z = x.toParArray +}
\ No newline at end of file diff --git a/test/files/neg/warn-unused-imports.check b/test/files/neg/warn-unused-imports.check index 1b938f4fd7..36c6dd03c3 100644 --- a/test/files/neg/warn-unused-imports.check +++ b/test/files/neg/warn-unused-imports.check @@ -1,11 +1,3 @@ -warn-unused-imports.scala:7: warning: it is not recommended to define classes/objects inside of package objects. -If possible, define class A in package p1 instead. - class A - ^ -warn-unused-imports.scala:13: warning: it is not recommended to define classes/objects inside of package objects. -If possible, define class A in package p2 instead. - class A - ^ warn-unused-imports.scala:57: warning: Unused import import p1.A // warn ^ @@ -36,9 +28,6 @@ warn-unused-imports.scala:98: warning: Unused import warn-unused-imports.scala:118: warning: Unused import import p1.A // warn ^ -warn-unused-imports.scala:99: warning: local trait Warn is never used - trait Warn { // warn about unused local trait for good measure - ^ error: No warnings can be incurred under -Xfatal-warnings. -13 warnings found +10 warnings found one error found diff --git a/test/files/neg/warn-unused-imports.flags b/test/files/neg/warn-unused-imports.flags index 954eaba352..24db705df1 100644 --- a/test/files/neg/warn-unused-imports.flags +++ b/test/files/neg/warn-unused-imports.flags @@ -1 +1 @@ --Xfatal-warnings -Xlint +-Xfatal-warnings -Ywarn-unused-import diff --git a/test/files/neg/warn-unused-privates.flags b/test/files/neg/warn-unused-privates.flags index 7949c2afa2..25474aefb3 100644 --- a/test/files/neg/warn-unused-privates.flags +++ b/test/files/neg/warn-unused-privates.flags @@ -1 +1 @@ --Xlint -Xfatal-warnings +-Ywarn-unused -Xfatal-warnings diff --git a/test/files/pos/t5165b/TestAnnotation_1.java b/test/files/pos/t5165b/TestAnnotation_1.java new file mode 100644 index 0000000000..02eb3f9d4c --- /dev/null +++ b/test/files/pos/t5165b/TestAnnotation_1.java @@ -0,0 +1,11 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface TestAnnotation_1 { + public enum TestEnumOne { A, B } + public enum TestEnumTwo { C, D } + + public TestEnumOne one(); + public TestEnumTwo two(); + public String strVal(); +} diff --git a/test/files/pos/t5165b/TestObject_3.scala b/test/files/pos/t5165b/TestObject_3.scala new file mode 100644 index 0000000000..eaf244e9d0 --- /dev/null +++ b/test/files/pos/t5165b/TestObject_3.scala @@ -0,0 +1,3 @@ + +object TestObject extends TestTrait + diff --git a/test/files/pos/t5165b/TestTrait_2.scala b/test/files/pos/t5165b/TestTrait_2.scala new file mode 100644 index 0000000000..ab4facebcd --- /dev/null +++ b/test/files/pos/t5165b/TestTrait_2.scala @@ -0,0 +1,3 @@ + +@TestAnnotation_1(one=TestAnnotation_1.TestEnumOne.A, two=TestAnnotation_1.TestEnumTwo.C, strVal="something") +trait TestTrait diff --git a/test/files/run/t5134.scala b/test/files/run/t5134.scala new file mode 100644 index 0000000000..384442fda2 --- /dev/null +++ b/test/files/run/t5134.scala @@ -0,0 +1,8 @@ +import language._ + +object Test extends App { + def b = new AnyRef { + def a= () + } + b.a match { case _ => () } +} diff --git a/test/files/run/t5565.scala b/test/files/run/t5565.scala new file mode 100644 index 0000000000..9ced87ca21 --- /dev/null +++ b/test/files/run/t5565.scala @@ -0,0 +1,12 @@ +import scala.language.reflectiveCalls +import scala.language.implicitConversions + +object Test extends App { + implicit def doubleWithApproxEquals(d: Double) = new { + def ~==(v: Double, margin: Double = 0.001): Boolean = + math.abs(d - v) < margin + } + + assert(math.abs(-4.0) ~== (4.0, 0.001)) + assert(math.abs(-4.0) ~== 4.0) +} diff --git a/test/files/run/t7932.check b/test/files/run/t7932.check new file mode 100644 index 0000000000..13d64f1d3c --- /dev/null +++ b/test/files/run/t7932.check @@ -0,0 +1,3 @@ +warning: there were 1 feature warning(s); re-run with -feature for details +public Category<?> C.category() +public Category<scala.Tuple2> C.category1() diff --git a/test/files/run/t7932.scala b/test/files/run/t7932.scala new file mode 100644 index 0000000000..8743abff88 --- /dev/null +++ b/test/files/run/t7932.scala @@ -0,0 +1,11 @@ +class Category[M[_, _]] +trait M[F] { + type X[a, b] = F + def category: Category[X] = null + def category1: Category[Tuple2] = null +} +abstract class C extends M[Float] +object Test extends App { + val ms = classOf[C].getMethods.filter(_.getName.startsWith("category")) + println(ms.map(_.toGenericString).sorted.mkString("\n")) +} |