summaryrefslogtreecommitdiff
path: root/test/files/pos/bug711.scala
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2007-06-06 00:40:56 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2007-06-06 00:40:56 +0000
commitee41bd58d4e28008070b4d705511beab36f645e1 (patch)
tree2e40454199dc66adc0fa384275a31972aef05b96 /test/files/pos/bug711.scala
parentcea527a9dc7cfef933ed911b8196858f412827b2 (diff)
downloadscala-ee41bd58d4e28008070b4d705511beab36f645e1.tar.gz
scala-ee41bd58d4e28008070b4d705511beab36f645e1.tar.bz2
scala-ee41bd58d4e28008070b4d705511beab36f645e1.zip
Fixed structural subtyping to work when JVM 1.5...
Fixed structural subtyping to work when JVM 1.5 target is used. Bug 711 no longer is “neg” thanks to structural subtyping.
Diffstat (limited to 'test/files/pos/bug711.scala')
-rw-r--r--test/files/pos/bug711.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/pos/bug711.scala b/test/files/pos/bug711.scala
new file mode 100644
index 0000000000..70fcc7f0d0
--- /dev/null
+++ b/test/files/pos/bug711.scala
@@ -0,0 +1,14 @@
+abstract class Component
+
+class Button extends Component {
+ def sayHey: Unit = Console.println("Hey, I'm a button") }
+
+abstract class Origin {
+ val delegate: Component }
+
+object main extends Origin with Application {
+ val delegate: Component {
+ def sayHey: Unit
+ } = new Button
+ delegate.sayHey
+}