aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/any-vs-anyref.check
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
commit9ef5f6817688f814a3450126aa7383b0928e80a0 (patch)
tree5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/neg/any-vs-anyref.check
parent194be919664447631ba55446eb4874979c908d27 (diff)
downloaddotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/neg/any-vs-anyref.check')
-rw-r--r--tests/untried/neg/any-vs-anyref.check80
1 files changed, 80 insertions, 0 deletions
diff --git a/tests/untried/neg/any-vs-anyref.check b/tests/untried/neg/any-vs-anyref.check
new file mode 100644
index 000000000..7378f0495
--- /dev/null
+++ b/tests/untried/neg/any-vs-anyref.check
@@ -0,0 +1,80 @@
+any-vs-anyref.scala:6: error: type mismatch;
+ found : a.type (with underlying type A)
+ required: AnyRef
+Note that A is bounded only by Equals, which means AnyRef is not a known parent.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo1[A <: Product](a: A) = { type X = a.type }
+ ^
+any-vs-anyref.scala:7: error: type mismatch;
+ found : a.type (with underlying type A)
+ required: AnyRef
+Note that A is bounded only by Product, Quux, which means AnyRef is not a known parent.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo2[A <: Product with Quux](a: A) = { type X = a.type }
+ ^
+any-vs-anyref.scala:8: error: type mismatch;
+ found : a.type (with underlying type Product)
+ required: AnyRef
+Note that Product extends Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo3(a: Product) = { type X = a.type }
+ ^
+any-vs-anyref.scala:9: error: type mismatch;
+ found : Product with Quux
+ required: AnyRef
+Note that the parents of this type (Product, Quux) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo4(a: Product with Quux) = { type X = a.type }
+ ^
+any-vs-anyref.scala:10: error: value eq is not a member of Quux with Product
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo5(x: Quux with Product) = (x eq "abc") && ("abc" eq x)
+ ^
+any-vs-anyref.scala:10: error: type mismatch;
+ found : Quux with Product
+ required: AnyRef
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo5(x: Quux with Product) = (x eq "abc") && ("abc" eq x)
+ ^
+any-vs-anyref.scala:11: error: value eq is not a member of Quux with Product{def f: Int}
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo6(x: Quux with Product { def f: Int }) = (x eq "abc") && ("abc" eq x)
+ ^
+any-vs-anyref.scala:11: error: type mismatch;
+ found : Quux with Product{def f: Int}
+ required: AnyRef
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo6(x: Quux with Product { def f: Int }) = (x eq "abc") && ("abc" eq x)
+ ^
+any-vs-anyref.scala:12: error: type mismatch;
+ found : Quux with Product{def eq(other: String): Boolean}
+ required: AnyRef
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo7(x: Quux with Product { def eq(other: String): Boolean }) = (x eq "abc") && ("abc" eq x)
+ ^
+any-vs-anyref.scala:22: error: value eq is not a member of Bippy
+Note that Bippy extends Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def bad1(x: Bippy, y: Bippy) = x eq y
+ ^
+any-vs-anyref.scala:27: error: type mismatch;
+ found : Quux{def g(x: String): String}
+ required: Quux{def g(x: Int): Int}
+ f(new Quux { def g(x: String) = x })
+ ^
+11 errors found