summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2016-05-23 16:20:01 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2016-05-23 16:20:01 +0200
commit82d9551773b56730df8cfcfc7a40a0d1c7fb2bf9 (patch)
tree700313eac714888a2e2d855031c76f1935bad980 /test/files
parent8e92ba0eb8c1e651c56493d00bc478ae7a3e9f39 (diff)
parent45e607d3879623d5163f47c17c717904f6867ef6 (diff)
downloadscala-82d9551773b56730df8cfcfc7a40a0d1c7fb2bf9.tar.gz
scala-82d9551773b56730df8cfcfc7a40a0d1c7fb2bf9.tar.bz2
scala-82d9551773b56730df8cfcfc7a40a0d1c7fb2bf9.zip
Merge pull request #5162 from milessabin/t9361
SI-9361 fixed assert allowing display of improved error message.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t9361.check11
-rw-r--r--test/files/neg/t9361.scala5
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/neg/t9361.check b/test/files/neg/t9361.check
new file mode 100644
index 0000000000..847d137f7d
--- /dev/null
+++ b/test/files/neg/t9361.check
@@ -0,0 +1,11 @@
+t9361.scala:4: error: type mismatch;
+ found : Tc[_$2] where type _$2
+ required: Nothing[]
+ new Foo { def tc = null.asInstanceOf[Tc[_]] }
+ ^
+t9361.scala:4: error: type mismatch;
+ found : Foo[Nothing]
+ required: Foo[Tc]{type T = Nothing}
+ new Foo { def tc = null.asInstanceOf[Tc[_]] }
+ ^
+two errors found
diff --git a/test/files/neg/t9361.scala b/test/files/neg/t9361.scala
new file mode 100644
index 0000000000..b689461e4d
--- /dev/null
+++ b/test/files/neg/t9361.scala
@@ -0,0 +1,5 @@
+abstract class Foo[Tc[_]] { def tc: Tc[_] }
+object Foo {
+ def foo[Tc[_]](): Foo[Tc] { type T = Nothing } =
+ new Foo { def tc = null.asInstanceOf[Tc[_]] }
+}