diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 08:58:32 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 09:11:53 +0100 |
commit | fd623f83a1aa9852b334cd9a1444d10333df1d9a (patch) | |
tree | 558a784dba74279d3d519641fc46d4f3f359718b /test/files/pos/t8301b.scala | |
parent | b31f9ab97912ad2d26df16ef223b874970175388 (diff) | |
download | scala-fd623f83a1aa9852b334cd9a1444d10333df1d9a.tar.gz scala-fd623f83a1aa9852b334cd9a1444d10333df1d9a.tar.bz2 scala-fd623f83a1aa9852b334cd9a1444d10333df1d9a.zip |
SI-8304 Allow volatile-typed Idents as stable ident patterns
As we did for `Select`-s in SI-6815 / fada1ef6.
Diffstat (limited to 'test/files/pos/t8301b.scala')
-rw-r--r-- | test/files/pos/t8301b.scala | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/files/pos/t8301b.scala b/test/files/pos/t8301b.scala new file mode 100644 index 0000000000..5641547c18 --- /dev/null +++ b/test/files/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._ + } +} |