From 9ef5f6817688f814a3450126aa7383b0928e80a0 Mon Sep 17 00:00:00 2001 From: Samuel Gruetter Date: Wed, 12 Mar 2014 22:44:33 +0100 Subject: add tests from scala/test/files/{pos,neg} with explicit Unit return type --- tests/untried/pos/t8301b.scala | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/untried/pos/t8301b.scala (limited to 'tests/untried/pos/t8301b.scala') diff --git a/tests/untried/pos/t8301b.scala b/tests/untried/pos/t8301b.scala new file mode 100644 index 000000000..5641547c1 --- /dev/null +++ b/tests/untried/pos/t8301b.scala @@ -0,0 +1,36 @@ +// cf. pos/t8300-patmat.scala +trait Universe { + type Name >: Null <: AnyRef with NameApi + trait NameApi + + type TermName >: Null <: TermNameApi with Name + trait TermNameApi extends NameApi +} + +object Test extends App { + val u: Universe = ??? + import u._ + + val ScalaName: TermName = ??? + locally { + + ??? match { + case Test.ScalaName => ??? + } + import Test.ScalaName._ + + ??? match { + case ScalaName => ??? + } + import ScalaName._ + + // both the pattern and import led to + // stable identifier required, but SN found. Note that value SN + // is not stable because its type, Test.u.TermName, is volatile. + val SN = ScalaName + ??? match { + case SN => ??? + } + import SN._ + } +} -- cgit v1.2.3