summaryrefslogtreecommitdiff
path: root/test/files/pos/bug616.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-05-31 09:47:38 +0000
committerMartin Odersky <odersky@gmail.com>2006-05-31 09:47:38 +0000
commit23904f63552d7cb98865d5a07101e2e9795d2ad1 (patch)
tree897cd8dfd243c5921570ebd1c091c111cf146d5a /test/files/pos/bug616.scala
parentcab784ad14708b1c2b95d8af44b20f802667e7b2 (diff)
downloadscala-23904f63552d7cb98865d5a07101e2e9795d2ad1.tar.gz
scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.tar.bz2
scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.zip
fixed bugs 616, 617
Diffstat (limited to 'test/files/pos/bug616.scala')
-rw-r--r--test/files/pos/bug616.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/pos/bug616.scala b/test/files/pos/bug616.scala
new file mode 100644
index 0000000000..bf757a58d3
--- /dev/null
+++ b/test/files/pos/bug616.scala
@@ -0,0 +1,11 @@
+object testImplicit {
+ implicit def foo2bar(foo :Foo) :Bar = foo.bar
+ class Foo(val bar :Bar) {
+ def testCoercion = {val a = this; a.baz} // here, foo2bar is inferred by the compiler, as expected
+ //def testCoercionThisImplicit = baz // --> error: not found: value baz
+ def testCoercionThisExplicit: Any = this.baz // --> error: value baz is not a member of Foo
+ }
+ trait Bar { def baz :unit}
+}
+// mentioned before: http://thread.gmane.org/gmane.comp.lang.scala/2038,
+// but couldn't find a bug report