diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-23 19:59:31 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-23 19:59:31 -0800 |
commit | faa6cfcf404b4d172f20b3ed01ba3bd59427b700 (patch) | |
tree | 2206b8defd7c433a2ef1dee3bd1b3f219d60949e /test/files/pos | |
parent | 5b498a2612f967c944fa1ed4f63a09d6acc41791 (diff) | |
parent | 57b91c5ee794cb8b66e298594a95a3fc829171f6 (diff) | |
download | scala-faa6cfcf404b4d172f20b3ed01ba3bd59427b700.tar.gz scala-faa6cfcf404b4d172f20b3ed01ba3bd59427b700.tar.bz2 scala-faa6cfcf404b4d172f20b3ed01ba3bd59427b700.zip |
Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10.wip-x
# By Jason Zaugg (8) and others
# Via Adriaan Moors (6) and Josh Suereth (5)
* origin/2.10.0-wip:
Removing controversial `either` method from Futures API.
SI-6624 set info of case pattern binder to help find case field accessors
Fixes SI-6628, Revert "Fix for view isEmpty."
SI-6661 - Remove obsolete implicit parameter of scala.concurrent.promise method
Fixes SI-6559 - StringContext not using passed in escape function.
SI-6648 copyAttrs must preserve TypeTree#wasEmpty
Fix raw string interpolator: string parts which were after the first argument were still escaped
Update comment.
SI-6646 `ident` or Ident is always new binding.
SI-6440 Address regressions around MissingRequirementError
Refine the message and triggering of MissingRequirementError.
SI-6640 Better reporting of deficient classpaths.
SI-6644 Account for varargs in extmethod forwarder
SI-6646 Fix regression in for desugaring.
Update tools/epfl-publish
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t6624.scala | 28 | ||||
-rw-r--r-- | test/files/pos/t6648.scala | 24 |
2 files changed, 52 insertions, 0 deletions
diff --git a/test/files/pos/t6624.scala b/test/files/pos/t6624.scala new file mode 100644 index 0000000000..1a92b92d53 --- /dev/null +++ b/test/files/pos/t6624.scala @@ -0,0 +1,28 @@ +sealed trait KList[+M[_]] + +case class KCons[M[_], +T <: KList[M]]( + tail: T +) extends KList[M] + +case class KNil[M[_]]() extends KList[M] + +object Test { + val klist: KCons[Option, KCons[Option, KCons[Option, KNil[Nothing]]]] = ??? + + // crashes with + // "Exception in thread "main" scala.reflect.internal.Types$TypeError: value _1 is not a member + // of KCons[Option,KCons[Option,KNil[Nothing]]]" + klist match { + case KCons(KCons(KCons(_))) => + } + + // fails with a similar message as an error, rather than a crash. + klist match { + case KCons(KCons(_)) => + } + + // succeeds + klist match { + case KCons(_) => + } +}
\ No newline at end of file diff --git a/test/files/pos/t6648.scala b/test/files/pos/t6648.scala new file mode 100644 index 0000000000..9593ebfee9 --- /dev/null +++ b/test/files/pos/t6648.scala @@ -0,0 +1,24 @@ +abstract class Node extends NodeSeq +trait NodeSeq extends Seq[Node] +object NodeSeq { + implicit def seqToNodeSeq(ns: Seq[Node]): NodeSeq = ??? + def foo[B, That](f: Seq[B])(implicit bf: scala.collection.generic.CanBuildFrom[Seq[Int], B, That]): That = ??? +} + +class Transformer { + def apply(nodes: Any): Any = ??? +} + +object transformer1 extends Transformer { + // Adding explicit type arguments, or making the impilcit view + // seqToNodeSeq explicit avoids the crash + NodeSeq.foo { + // These both avoid the crash: + // val t = new Transformer {}; t.apply(null) + // new Transformer().apply(null) + new Transformer {}.apply(null) + + null: NodeSeq + }: NodeSeq +} + |