diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-08-29 13:36:15 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-29 13:36:15 +1000 |
commit | 90bced5b659e174b01a44999ef7ce4b810c73c4a (patch) | |
tree | 011dea592e85b973f87f00bc0fe5d4003911bcba /test/files/run | |
parent | 18b75748dfb3e790b4c4be67155e2f1682fc85e2 (diff) | |
parent | e9e8618070d17ab167249d8197cb9c6e72891ad2 (diff) | |
download | scala-90bced5b659e174b01a44999ef7ce4b810c73c4a.tar.gz scala-90bced5b659e174b01a44999ef7ce4b810c73c4a.tar.bz2 scala-90bced5b659e174b01a44999ef7ce4b810c73c4a.zip |
Merge pull request #5263 from retronym/review/5041
SI-5294 SI-6161 Hard graft in asSeenFrom, refinements, and existentials [ci: last-only]
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5294.scala | 22 | ||||
-rw-r--r-- | test/files/run/t7747-repl.scala | 4 |
2 files changed, 23 insertions, 3 deletions
diff --git a/test/files/run/t5294.scala b/test/files/run/t5294.scala new file mode 100644 index 0000000000..2551ae89a6 --- /dev/null +++ b/test/files/run/t5294.scala @@ -0,0 +1,22 @@ +import scala.language.higherKinds + +package p { + trait T[+A, +CC] { + def t: CC + } + class C { + def test[CC[X] <: T[X,String] with T[X,Int]](from: CC[_]): Unit = () + } +} + +object Test { + def main(args: Array[String]): Unit = { + val symtab = reflect.runtime.universe.asInstanceOf[reflect.internal.SymbolTable] + val CTpe = reflect.runtime.universe.typeOf[p.C].asInstanceOf[symtab.Type] + val TClass = reflect.runtime.universe.symbolOf[p.T[_, _]].asInstanceOf[symtab.Symbol] + import symtab._ + val from = CTpe.member(TermName("test")).paramss.head.head + assert(from.baseClasses contains TClass) + assert(from.info.baseTypeIndex(TClass) != -1) // was failing! + } +} diff --git a/test/files/run/t7747-repl.scala b/test/files/run/t7747-repl.scala index 0094d3ba98..8203f4c802 100644 --- a/test/files/run/t7747-repl.scala +++ b/test/files/run/t7747-repl.scala @@ -10,9 +10,7 @@ object Test extends ReplTest { override def normalize(s: String) = { // replace indylambda function names by <function0> - val s2 = """\$Lambda.*""".r.replaceAllIn(s, "<function0>") - // Normalize ordering of LUB - s2.replace("Serializable with Product", "Product with Serializable") + """\$Lambda.*""".r.replaceAllIn(s, "<function0>") } def code = """ |