diff options
author | Som Snytt <som.snytt@gmail.com> | 2012-05-02 10:19:05 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2012-05-02 22:21:51 -0700 |
commit | aabe71f989f023d64b6c52680485e4cacb4e88b9 (patch) | |
tree | 6ad9b57f2a04d79dc2d38e9b5f06ba71c8688e33 /test/files/pos/t5727.scala | |
parent | b27abca41a2503747b3aeeecf8b8cb355159265f (diff) | |
download | scala-aabe71f989f023d64b6c52680485e4cacb4e88b9.tar.gz scala-aabe71f989f023d64b6c52680485e4cacb4e88b9.tar.bz2 scala-aabe71f989f023d64b6c52680485e4cacb4e88b9.zip |
SI-5720: Qual block doesn't update sym owner
A one-line change to blockWithQualifier. The symptom is
undefined tmp var symbols in the backend; lamba lift thinks
the tmp var is free and adds it to anonfun ctors.
Diffstat (limited to 'test/files/pos/t5727.scala')
-rw-r--r-- | test/files/pos/t5727.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/pos/t5727.scala b/test/files/pos/t5727.scala new file mode 100644 index 0000000000..e091d827b4 --- /dev/null +++ b/test/files/pos/t5727.scala @@ -0,0 +1,31 @@ + +/* + * We like operators, bar none. + */ +object Test { + + trait SomeInfo + case object NoInfo extends SomeInfo + + sealed abstract class Res[+T] + case object NotRes extends Res[Nothing] + + + abstract class Base[+T] { + def apply(f: String): Res[T] + // 'i' crashes the compiler, similarly if we use currying + //def |[U >: T](a: => Base[U], i: SomeInfo = NoInfo): Base[U] = null + def bar[U >: T](a: => Base[U], i: SomeInfo = NoInfo): Base[U] = null + } + + implicit def fromStringToBase(a: String): Base[String] = new Base[String] { def apply(in: String) = NotRes } + + // bug + //def Sample: Base[Any] = ( rep("foo" | "bar") | "sth") + def Sample: Base[Any] = ( rep("foo" bar "bar") bar "sth") + + def rep[T](p: => Base[T]): Base[T] = null // whatever + + def main(args: Array[String]) { + } +} |