diff options
author | michelou <michelou@epfl.ch> | 2007-04-05 12:59:40 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-04-05 12:59:40 +0000 |
commit | b5b3ce4df69c6dd19506cd332a97c1ad6660e4a5 (patch) | |
tree | dd28bb694890839d94974e7c0ba52c9d3f7e12e0 /test/files/pos/bug0017.scala | |
parent | 7674f974c372ab1949a19490b48e5734711ded84 (diff) | |
download | scala-b5b3ce4df69c6dd19506cd332a97c1ad6660e4a5.tar.gz scala-b5b3ce4df69c6dd19506cd332a97c1ad6660e4a5.tar.bz2 scala-b5b3ce4df69c6dd19506cd332a97c1ad6660e4a5.zip |
4-digits numbering
Diffstat (limited to 'test/files/pos/bug0017.scala')
-rw-r--r-- | test/files/pos/bug0017.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/pos/bug0017.scala b/test/files/pos/bug0017.scala new file mode 100644 index 0000000000..d2bcda08d4 --- /dev/null +++ b/test/files/pos/bug0017.scala @@ -0,0 +1,21 @@ +class Quantity { + def getValue = 0; + def connect(c: Constraint) = c.newValue; +} + +abstract class Constraint(q: Quantity) { + def newValue: Unit; + q connect this +} + +class Adder(q: Quantity) extends Constraint(q) { + def newValue = Console.println(q.getValue); +} + +object Main { + def main(args: Array[String]): Unit = { + val x = new Quantity; + new Adder(x); + () + } +} |