diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-05-31 15:23:04 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-06-07 17:10:36 +0200 |
commit | 09b2f39731386cd5b3688d5c3badf75d956d4f6d (patch) | |
tree | d122fc0e96d6c1cd22d7e0d0b5ee523563d534e7 /tests | |
parent | 030ff82070197f0c126f5c0287e076b0f6b6dd8d (diff) | |
download | dotty-09b2f39731386cd5b3688d5c3badf75d956d4f6d.tar.gz dotty-09b2f39731386cd5b3688d5c3badf75d956d4f6d.tar.bz2 dotty-09b2f39731386cd5b3688d5c3badf75d956d4f6d.zip |
Make the dotty-bridge sbt project a subproject of dotty
Note that the dotty-bridge tests will not be run automatically by `test`
which is short for `dotty/test`, to run the dotty-bridge tests, do in sbt:
> dotty-bridge/test
> dotty-bridge/scripted
Original history: https://github.com/smarter/dotty-bridge/commits/master
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/implicit-scope-loop.scala | 17 | ||||
-rw-r--r-- | tests/pos/implicit_cache.scala | 16 | ||||
-rw-r--r-- | tests/pos/implicit_tparam.scala | 12 | ||||
-rw-r--r-- | tests/run/overload_directly_applicable.check | 1 | ||||
-rw-r--r-- | tests/run/overload_directly_applicable.scala | 16 |
5 files changed, 62 insertions, 0 deletions
diff --git a/tests/pos/implicit-scope-loop.scala b/tests/pos/implicit-scope-loop.scala new file mode 100644 index 000000000..162f1a52c --- /dev/null +++ b/tests/pos/implicit-scope-loop.scala @@ -0,0 +1,17 @@ +trait Dummy[T] + + +trait A[T] extends B +trait B extends Dummy[A[Int]] +object B { + implicit def theB: B = new B {} + implicit def theA: A[Int] = new A[Int] {} +} + +object Test { + def getB(implicit b: B) = b + def getA[T](implicit a: A[T]) = a + + getB + getA +}
\ No newline at end of file diff --git a/tests/pos/implicit_cache.scala b/tests/pos/implicit_cache.scala new file mode 100644 index 000000000..d124876e0 --- /dev/null +++ b/tests/pos/implicit_cache.scala @@ -0,0 +1,16 @@ +class A +object A { + implicit def theA: A = new A +} +class Foo[T] +object Foo { + implicit def theFoo: Foo[A] = new Foo[A] +} + +object Test { + def getFooA(implicit foo: Foo[A]) = foo + def getA(implicit a: A) = a + + getFooA + getA +} diff --git a/tests/pos/implicit_tparam.scala b/tests/pos/implicit_tparam.scala new file mode 100644 index 000000000..3b7cf9113 --- /dev/null +++ b/tests/pos/implicit_tparam.scala @@ -0,0 +1,12 @@ +class Foo[T] +class Bar extends Foo[A] + +class A +object A { + implicit val bar: Bar = new Bar +} + +object Test { + def getBar(implicit bar: Bar) = bar + getBar +} diff --git a/tests/run/overload_directly_applicable.check b/tests/run/overload_directly_applicable.check new file mode 100644 index 000000000..e2cf5e790 --- /dev/null +++ b/tests/run/overload_directly_applicable.check @@ -0,0 +1 @@ +C1 diff --git a/tests/run/overload_directly_applicable.scala b/tests/run/overload_directly_applicable.scala new file mode 100644 index 000000000..d204d424a --- /dev/null +++ b/tests/run/overload_directly_applicable.scala @@ -0,0 +1,16 @@ +class A +class B + +class C1 { + def f(x: A): Unit = println("C1") +} +class C2 extends C1 { + def f(x: B): Unit = println("C2") +} + +object Test extends C2 { + implicit def a2b(x: A): B = new B + def main(args: Array[String]): Unit = { + f(new A) + } +} |