diff options
Diffstat (limited to 'test/files/neg/tcpoly_variance.scala')
-rw-r--r-- | test/files/neg/tcpoly_variance.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/neg/tcpoly_variance.scala b/test/files/neg/tcpoly_variance.scala new file mode 100644 index 0000000000..8122938113 --- /dev/null +++ b/test/files/neg/tcpoly_variance.scala @@ -0,0 +1,7 @@ +class A[m[x]] { + def str: m[Object] = error("foo") +} + +class B[m[x]] extends A[m] { + override def str: m[String] = error("foo") // since x in m[x] is invariant, ! m[String] <: m[Object] +}
\ No newline at end of file |