diff options
author | odersky <odersky@gmail.com> | 2014-12-16 17:22:24 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2014-12-16 17:22:24 +0100 |
commit | 63e1bc95d4f72331fabf2fd838bb4e8d5b94ad67 (patch) | |
tree | c7ca3d3ae3fe85f34927dadf51b0927d125b9cb2 /tests/pos | |
parent | 981a21816e4cb10b8fbe4edcf0659fb3995d63f8 (diff) | |
parent | 413bcebf5a87102b1f1b2840b92b6a8017aa16df (diff) | |
download | dotty-63e1bc95d4f72331fabf2fd838bb4e8d5b94ad67.tar.gz dotty-63e1bc95d4f72331fabf2fd838bb4e8d5b94ad67.tar.bz2 dotty-63e1bc95d4f72331fabf2fd838bb4e8d5b94ad67.zip |
Merge pull request #282 from dotty-staging/fix/i0239-package-objects
Fix #239 - handling of package objects
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/i0239.scala | 24 | ||||
-rw-r--r-- | tests/pos/i239-packageObj.scala | 11 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/pos/i0239.scala b/tests/pos/i0239.scala new file mode 100644 index 000000000..0dfba7ea0 --- /dev/null +++ b/tests/pos/i0239.scala @@ -0,0 +1,24 @@ +package p { + class C[A] { + implicit def foo: M[A] = ??? + } + + object `package` extends C[String] + + object test0 { + def compute[A](implicit m: M[A]): A = ??? + val v = compute + val v1: String = v + } +} + +trait M[A] + +object test1 { + + def compute[A](implicit m: M[A]): A = ??? + + import p._ + val v = compute + val v1: String = v +} diff --git a/tests/pos/i239-packageObj.scala b/tests/pos/i239-packageObj.scala new file mode 100644 index 000000000..057bc1eec --- /dev/null +++ b/tests/pos/i239-packageObj.scala @@ -0,0 +1,11 @@ +package p { + class C[A] { def foo: A = ??? } + + object `package` extends C[String] +} + +object test { + + val x: String = p.foo + +} |