diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-01-28 23:12:10 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-01-28 23:12:10 -0800 |
commit | d392d56d6bf8b0ae9072b354e4ec68becd0df679 (patch) | |
tree | 9252ad047b4329ea8bf40ef1cca4f5b92459e11b /test/files | |
parent | cc3b9a23ebb453b827197e5ab5cba46a9e770f0c (diff) | |
parent | 7babdab9ace07884ce844af923c93e0dcd49f7ea (diff) | |
download | scala-d392d56d6bf8b0ae9072b354e4ec68becd0df679.tar.gz scala-d392d56d6bf8b0ae9072b354e4ec68becd0df679.tar.bz2 scala-d392d56d6bf8b0ae9072b354e4ec68becd0df679.zip |
Merge pull request #1936 from retronym/ticket/6891
SI-6891 Fix value class + tailrec crasher.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t6891.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t6891.scala | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/files/pos/t6891.flags b/test/files/pos/t6891.flags new file mode 100644 index 0000000000..fe048006aa --- /dev/null +++ b/test/files/pos/t6891.flags @@ -0,0 +1 @@ +-Ycheck:extmethods -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t6891.scala b/test/files/pos/t6891.scala new file mode 100644 index 0000000000..bed2d0d777 --- /dev/null +++ b/test/files/pos/t6891.scala @@ -0,0 +1,26 @@ +object O { + implicit class Foo[A](val value: String) extends AnyVal { + def bippy() = { + @annotation.tailrec def loop(x: A): Unit = loop(x) + () + } + + def boppy() = { + @annotation.tailrec def loop(x: value.type): Unit = loop(x) + () + } + + def beppy[C](c: => C) = { + () => c + @annotation.tailrec def loop(x: value.type): Unit = loop(x) + () => c + () + } + } + // uncaught exception during compilation: Types$TypeError("type mismatch; + // found : A(in method bippy$extension) + // required: A(in class Foo)") @ scala.tools.nsc.typechecker.Contexts$Context.issueCommon(Contexts.scala:396) + // error: scala.reflect.internal.Types$TypeError: type mismatch; + // found : A(in method bippy$extension) + // required: A(in class Foo) +} |