diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-11-10 12:45:43 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2014-11-10 12:45:43 +0100 |
commit | 5a7875fd0e6af19286f3ff125d4ad9b311a7ad7e (patch) | |
tree | 8914ab6c9e2ced919b79dbfa3f9437d81ff36084 /test/files/neg | |
parent | 02c08524b2dee1a83ed82ac945de8a1baaba09ac (diff) | |
parent | cbca4943884d23f0a588471ea68e733170d069af (diff) | |
download | scala-5a7875fd0e6af19286f3ff125d4ad9b311a7ad7e.tar.gz scala-5a7875fd0e6af19286f3ff125d4ad9b311a7ad7e.tar.bz2 scala-5a7875fd0e6af19286f3ff125d4ad9b311a7ad7e.zip |
Merge pull request #4101 from adriaanm/sam-ex
[sammy] eta-expansion, overloading, existentials
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/sammy_error_exist_no_crash.check | 6 | ||||
-rw-r--r-- | test/files/neg/sammy_error_exist_no_crash.flags | 1 | ||||
-rw-r--r-- | test/files/neg/sammy_error_exist_no_crash.scala | 6 | ||||
-rw-r--r-- | test/files/neg/sammy_restrictions.scala | 28 |
4 files changed, 27 insertions, 14 deletions
diff --git a/test/files/neg/sammy_error_exist_no_crash.check b/test/files/neg/sammy_error_exist_no_crash.check new file mode 100644 index 0000000000..a0d2237ce0 --- /dev/null +++ b/test/files/neg/sammy_error_exist_no_crash.check @@ -0,0 +1,6 @@ +sammy_error_exist_no_crash.scala:5: error: Could not derive subclass of F[? >: String] + (with SAM `def method apply(s: String)Int`) + based on: ((x$1: String) => x$1.<parseInt: error>). + bar(_.parseInt) + ^ +one error found diff --git a/test/files/neg/sammy_error_exist_no_crash.flags b/test/files/neg/sammy_error_exist_no_crash.flags new file mode 100644 index 0000000000..e1b37447c9 --- /dev/null +++ b/test/files/neg/sammy_error_exist_no_crash.flags @@ -0,0 +1 @@ +-Xexperimental
\ No newline at end of file diff --git a/test/files/neg/sammy_error_exist_no_crash.scala b/test/files/neg/sammy_error_exist_no_crash.scala new file mode 100644 index 0000000000..da7e47206f --- /dev/null +++ b/test/files/neg/sammy_error_exist_no_crash.scala @@ -0,0 +1,6 @@ +abstract class F[T] { def apply(s: T): Int } + +object NeedsNiceError { + def bar(x: F[_ >: String]) = ??? + bar(_.parseInt) +}
\ No newline at end of file diff --git a/test/files/neg/sammy_restrictions.scala b/test/files/neg/sammy_restrictions.scala index 5f1a04cd20..d003cfaf36 100644 --- a/test/files/neg/sammy_restrictions.scala +++ b/test/files/neg/sammy_restrictions.scala @@ -1,28 +1,28 @@ -class NoAbstract +abstract class NoAbstract -class TwoAbstract { def ap(a: Int): Int; def pa(a: Int): Int } +abstract class TwoAbstract { def ap(a: Int): Int; def pa(a: Int): Int } -class Base // check that the super class constructor isn't considered. -class NoEmptyConstructor(a: Int) extends Base { def this(a: String) = this(0); def ap(a: Int): Int } +abstract class Base // check that the super class constructor isn't considered. +abstract class NoEmptyConstructor(a: Int) extends Base { def this(a: String) = this(0); def ap(a: Int): Int } -class OneEmptyConstructor() { def this(a: Int) = this(); def ap(a: Int): Int } +abstract class OneEmptyConstructor() { def this(a: Int) = this(); def ap(a: Int): Int } -class OneEmptySecondaryConstructor(a: Int) { def this() = this(0); def ap(a: Int): Int } +abstract class OneEmptySecondaryConstructor(a: Int) { def this() = this(0); def ap(a: Int): Int } -class MultipleConstructorLists()() { def ap(a: Int): Int } +abstract class MultipleConstructorLists()() { def ap(a: Int): Int } -class MultipleMethodLists()() { def ap(a: Int)(): Int } +abstract class MultipleMethodLists()() { def ap(a: Int)(): Int } -class ImplicitConstructorParam()(implicit a: String) { def ap(a: Int): Int } +abstract class ImplicitConstructorParam()(implicit a: String) { def ap(a: Int): Int } -class ImplicitMethodParam() { def ap(a: Int)(implicit b: String): Int } +abstract class ImplicitMethodParam() { def ap(a: Int)(implicit b: String): Int } -class PolyClass[T] { def ap(a: T): T } +abstract class PolyClass[T] { def ap(a: T): T } -class PolyMethod { def ap[T](a: T): T } +abstract class PolyMethod { def ap[T](a: T): T } -class OneAbstract { def ap(a: Any): Any } -class DerivedOneAbstract extends OneAbstract +abstract class OneAbstract { def ap(a: Int): Any } +abstract class DerivedOneAbstract extends OneAbstract object Test { implicit val s: String = "" |