summaryrefslogtreecommitdiff
path: root/test/files/pos/t3079.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-02-26 11:04:02 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-02-26 11:04:02 +0000
commit00814d33caf1b321ccc24b85ff69f146ea1acdaa (patch)
treebae7ac297fc36469a20625681b88fb5561da3a95 /test/files/pos/t3079.scala
parentd5ae4c69b0a0700fe7a35e96516eaea5e7182322 (diff)
downloadscala-00814d33caf1b321ccc24b85ff69f146ea1acdaa.tar.gz
scala-00814d33caf1b321ccc24b85ff69f146ea1acdaa.tar.bz2
scala-00814d33caf1b321ccc24b85ff69f146ea1acdaa.zip
closes #2741 closes #3079 no review
worksforme
Diffstat (limited to 'test/files/pos/t3079.scala')
-rw-r--r--test/files/pos/t3079.scala17
1 files changed, 17 insertions, 0 deletions
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