From 4c04213b991596aa73dec3aa34cb8816a277f538 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 5 May 2012 01:23:45 -0700 Subject: Test cases. Closes SI-4482, SI-4651, SI-3702. Pending tests for SI-1832, SI-3439, SI-5091, SI-5231, SI-5265. --- test/pending/pos/t1832.scala | 10 ++++++++++ test/pending/pos/t3439.scala | 2 ++ test/pending/pos/t5091.scala | 11 +++++++++++ test/pending/pos/t5231.scala | 18 ++++++++++++++++++ test/pending/pos/t5265.scala | 21 +++++++++++++++++++++ 5 files changed, 62 insertions(+) create mode 100644 test/pending/pos/t1832.scala create mode 100644 test/pending/pos/t3439.scala create mode 100644 test/pending/pos/t5091.scala create mode 100644 test/pending/pos/t5231.scala create mode 100644 test/pending/pos/t5265.scala (limited to 'test/pending/pos') diff --git a/test/pending/pos/t1832.scala b/test/pending/pos/t1832.scala new file mode 100644 index 0000000000..bca863f4bd --- /dev/null +++ b/test/pending/pos/t1832.scala @@ -0,0 +1,10 @@ +// Edit by paulp: reduced. +trait Cloning { + trait Foo + def fn(g: Int => Unit): Foo + + implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null } + + val pool1 = 4 * fn { case i => i * 2 } + val pool2 = 4 * fn { case i: Int => i * 2 } +} diff --git a/test/pending/pos/t3439.scala b/test/pending/pos/t3439.scala new file mode 100644 index 0000000000..425f1aeeb5 --- /dev/null +++ b/test/pending/pos/t3439.scala @@ -0,0 +1,2 @@ +abstract class ParametricMessage[M: Manifest](msg: M) { def message = msg } +case class ParametricMessage1[M: Manifest](msg: M, p1: Class[_]) extends ParametricMessage(msg) diff --git a/test/pending/pos/t5091.scala b/test/pending/pos/t5091.scala new file mode 100644 index 0000000000..217e83f66d --- /dev/null +++ b/test/pending/pos/t5091.scala @@ -0,0 +1,11 @@ +object RecursiveValueNeedsType { + + def foo(param: String) = 42 + def bar(n: Int) = 42 + + { + val xxx = foo(param = null) + val param = bar(xxx) + } + +} diff --git a/test/pending/pos/t5231.scala b/test/pending/pos/t5231.scala new file mode 100644 index 0000000000..77e6631ebb --- /dev/null +++ b/test/pending/pos/t5231.scala @@ -0,0 +1,18 @@ +object Client { + sealed trait ConfigLike { + def clientID: Int + } + + object Config { + def apply() : ConfigBuilder = new ConfigBuilder() + implicit def build( cb: ConfigBuilder ) : Config = cb.build + } + + final class Config private[Client]( val clientID: Int ) + extends ConfigLike + + final class ConfigBuilder private () extends ConfigLike { + var clientID: Int = 0 + def build : Config = new Config( clientID ) + } +} diff --git a/test/pending/pos/t5265.scala b/test/pending/pos/t5265.scala new file mode 100644 index 0000000000..3be7d2187e --- /dev/null +++ b/test/pending/pos/t5265.scala @@ -0,0 +1,21 @@ +import java.util.Date + +trait TDate + +trait TT[A1,T1] + +trait TTFactory[F,G] { + def create(f: F) : TT[F,G] + def sample: F +} + +object Impls { + + // If the c1 is declared before c2, it compiles fine + implicit def c2(s: Date) = c1.create(s) + + implicit val c1 = new TTFactory[Date,TDate] { + def create(v: Date): TT[Date,TDate] = sys.error("") + def sample = new Date + } +} \ No newline at end of file -- cgit v1.2.3