From 00814d33caf1b321ccc24b85ff69f146ea1acdaa Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 26 Feb 2010 11:04:02 +0000 Subject: closes #2741 closes #3079 no review worksforme --- test/files/pos/t2741/2741-1.scala | 13 +++++++++++++ test/files/pos/t2741/2741-2.scala | 5 +++++ test/files/pos/t3079.scala | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 test/files/pos/t2741/2741-1.scala create mode 100644 test/files/pos/t2741/2741-2.scala create mode 100644 test/files/pos/t3079.scala diff --git a/test/files/pos/t2741/2741-1.scala b/test/files/pos/t2741/2741-1.scala new file mode 100644 index 0000000000..91c120ec1b --- /dev/null +++ b/test/files/pos/t2741/2741-1.scala @@ -0,0 +1,13 @@ +sealed trait Kleisli[M[_], A, B] + +trait PartialApplyKA[T[_[_], _, _], M[_], A] { + type Apply[B] = T[M, A, B] +} + +trait MA[M[_], A] + +trait MAs { + val a: MA[PartialApplyKA[Kleisli, List, String]#Apply, Int] = null +} + +object Scalaz extends MAs diff --git a/test/files/pos/t2741/2741-2.scala b/test/files/pos/t2741/2741-2.scala new file mode 100644 index 0000000000..41f6a64260 --- /dev/null +++ b/test/files/pos/t2741/2741-2.scala @@ -0,0 +1,5 @@ +// object Test compiles jointly, but not separately. +object Test { + import Scalaz._ + Scalaz.a +} \ No newline at end of file diff --git a/test/files/pos/t3079.scala b/test/files/pos/t3079.scala new file mode 100644 index 0000000000..fa732ea516 --- /dev/null +++ b/test/files/pos/t3079.scala @@ -0,0 +1,17 @@ +sealed trait Identity[A] { + val value: A +} + +trait Coerce[A, B] { + def unwrap: (A => B) +} + +object Coerce { + def IdentityCoerce[B] = new Coerce[Identity[B], B] { + // java.lang.Error: A in trait Identity cannot be instantiated from ?x$1.type + def unwrap = _.value + + // Providing the type of _ works around the problem. + //def unwrap = (_: Identity[B]).value + } +} \ No newline at end of file -- cgit v1.2.3