From 45e607d3879623d5163f47c17c717904f6867ef6 Mon Sep 17 00:00:00 2001 From: Miles Sabin Date: Sat, 14 May 2016 14:12:43 +0100 Subject: SI-9361 fixed assert allowing display of improved error message. --- test/files/neg/t9361.check | 11 +++++++++++ test/files/neg/t9361.scala | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 test/files/neg/t9361.check create mode 100644 test/files/neg/t9361.scala (limited to 'test/files/neg') 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[_]] } +} -- cgit v1.2.3