diff options
author | Martin Odersky <odersky@gmail.com> | 2006-04-25 14:01:59 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-04-25 14:01:59 +0000 |
commit | 88cd71a283f25b20414b1a22b9fded83692ffc14 (patch) | |
tree | 921d9a72ae56ac70d11ba1a58ee274cb8808a60d /test/pending/pos/moors.scala | |
parent | 8e1da29a68f7d494a89a1922e3b30e39b245da63 (diff) | |
download | scala-88cd71a283f25b20414b1a22b9fded83692ffc14.tar.gz scala-88cd71a283f25b20414b1a22b9fded83692ffc14.tar.bz2 scala-88cd71a283f25b20414b1a22b9fded83692ffc14.zip |
Diffstat (limited to 'test/pending/pos/moors.scala')
-rw-r--r-- | test/pending/pos/moors.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/pending/pos/moors.scala b/test/pending/pos/moors.scala new file mode 100644 index 0000000000..4f7346f57f --- /dev/null +++ b/test/pending/pos/moors.scala @@ -0,0 +1,12 @@ +object Test { + + implicit def foo2bar(foo :Foo) :Bar = foo.bar + + class Foo(val bar :Bar) { + def testCoercion ={ val a: this.type = this; a.baz /* here, foo2bar is inferred by the compiler, as expected */} + def testCoercionThis = baz // --> error: not found: value baz + def testCoercionThis = (this: Foo).baz // --> error: value baz is not a member of Foo + } + + class Bar { def baz = System.out.println("baz")} +} |