diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 18:44:45 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 18:44:45 +0100 |
commit | 2a00f01ae3f8eaf2e076e36a2236b919169005dd (patch) | |
tree | 05864172c40626cfb207aa3bcddcdc218068b531 /test/files | |
parent | 21fb7dc6f6dc8bb9f8613b7e620fc4f40f9df4ed (diff) | |
parent | fd623f83a1aa9852b334cd9a1444d10333df1d9a (diff) | |
download | scala-2a00f01ae3f8eaf2e076e36a2236b919169005dd.tar.gz scala-2a00f01ae3f8eaf2e076e36a2236b919169005dd.tar.bz2 scala-2a00f01ae3f8eaf2e076e36a2236b919169005dd.zip |
Merge pull request #3545 from retronym/topic/8301
SI-8301 fix regression with refinement subtyping, wildcard type.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t8301.scala | 19 | ||||
-rw-r--r-- | test/files/pos/t8301b.scala | 36 |
2 files changed, 55 insertions, 0 deletions
diff --git a/test/files/pos/t8301.scala b/test/files/pos/t8301.scala new file mode 100644 index 0000000000..2d10864c57 --- /dev/null +++ b/test/files/pos/t8301.scala @@ -0,0 +1,19 @@ +trait Universe { + type Symbol >: Null <: AnyRef with SymbolApi + trait SymbolApi + + type TypeSymbol >: Null <: TypeSymbolApi with Symbol + trait TypeSymbolApi + + implicit class CompatibleSymbol(sym: Symbol) { + def asFreeType: TypeSymbol = ??? + } +} + +object Test extends App { + val u: Universe = ??? + import u._ + + val sym: Symbol = ??? + sym.asFreeType +} 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._ + } +} |