diff options
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/builder.check | 1 | ||||
-rw-r--r-- | tests/run/builder.scala | 51 | ||||
-rw-r--r-- | tests/run/i1990b.check | 1 | ||||
-rw-r--r-- | tests/run/i1990b.scala | 20 | ||||
-rw-r--r-- | tests/run/t1618.scala | 11 | ||||
-rw-r--r-- | tests/run/t7775.scala | 17 |
6 files changed, 73 insertions, 28 deletions
diff --git a/tests/run/builder.check b/tests/run/builder.check new file mode 100644 index 000000000..48f7d9253 --- /dev/null +++ b/tests/run/builder.check @@ -0,0 +1 @@ +Table(Row(Cell(A1), Cell(B1)), Row(Cell(A2), Cell(B2))) diff --git a/tests/run/builder.scala b/tests/run/builder.scala new file mode 100644 index 000000000..532a95071 --- /dev/null +++ b/tests/run/builder.scala @@ -0,0 +1,51 @@ +import collection.mutable.ArrayBuffer + +class Table { + val rows = new ArrayBuffer[Row] + def add(r: Row): Unit = rows += r + override def toString = rows.mkString("Table(", ", ", ")") +} + +class Row { + val cells = new ArrayBuffer[Cell] + def add(c: Cell): Unit = cells += c + override def toString = cells.mkString("Row(", ", ", ")") +} + +class Cell(elem: String) { + override def toString = s"Cell($elem)" +} + +object Test { + + def table(init: implicit Table => Unit) = { + implicit val t = new Table + init + t + } + + def row(init: implicit Row => Unit)(implicit t: Table) = { + implicit val r = new Row + init + t.add(r) + } + + def cell(str: String)(implicit r: Row) = + r.add(new Cell(str)) + + val data = + table { + row { + cell("A1") + cell("B1") + } + row { + cell("A2") + cell("B2") + } + } + + def main(args: Array[String]) = { + println(data) + } +} diff --git a/tests/run/i1990b.check b/tests/run/i1990b.check new file mode 100644 index 000000000..dd84bc9fb --- /dev/null +++ b/tests/run/i1990b.check @@ -0,0 +1 @@ +C() diff --git a/tests/run/i1990b.scala b/tests/run/i1990b.scala new file mode 100644 index 000000000..2460208db --- /dev/null +++ b/tests/run/i1990b.scala @@ -0,0 +1,20 @@ +trait A { self => + class Foo { + inline def inlineMeth: Unit = { + println(self) + } + } +} + +case class A2() extends A { + case class C() extends Foo with A + + val c = new C + (new c.Foo).inlineMeth +} + +object Test { + def main(args: Array[String]): Unit = { + new A2 + } +} diff --git a/tests/run/t1618.scala b/tests/run/t1618.scala deleted file mode 100644 index 248af9b4f..000000000 --- a/tests/run/t1618.scala +++ /dev/null @@ -1,11 +0,0 @@ - -object Test extends dotty.runtime.LegacyApp { - import scala.tools.nsc.io._ - - val dir: VirtualDirectory = new VirtualDirectory("foo", None) - dir.subdirectoryNamed("foo") - assert(dir.lookupName("foo", true) != null) - -} - - diff --git a/tests/run/t7775.scala b/tests/run/t7775.scala deleted file mode 100644 index bc6a67d0e..000000000 --- a/tests/run/t7775.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.concurrent.{duration, Future, Await, ExecutionContext} -import scala.tools.nsc.Settings -import ExecutionContext.Implicits.global - -// Was failing pretty regularly with a ConcurrentModificationException as -// WrappedProperties#systemProperties iterated directly over the mutable -// global system properties map. -object Test { - def main(args: Array[String]): Unit = { - val tries = 1000 // YMMV - val compiler = Future { - for(_ <- 1 to tries) new Settings(_ => {}) - } - for(i <- 1 to tries * 10) System.setProperty(s"foo$i", i.toString) - Await.result(compiler, duration.Duration.Inf) - } -} |