diff options
author | Martin Odersky <odersky@gmail.com> | 2006-12-04 17:41:36 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-12-04 17:41:36 +0000 |
commit | 67dfced37f9b5d7a2b7f80f4da7fb5716f557350 (patch) | |
tree | c62c6fafcd14d847d45baa8b6155d9c52b76cbfc /test/files/neg | |
parent | 525018c3cab1aaeb6644e9dacae2ab36ffa28d13 (diff) | |
download | scala-67dfced37f9b5d7a2b7f80f4da7fb5716f557350.tar.gz scala-67dfced37f9b5d7a2b7f80f4da7fb5716f557350.tar.bz2 scala-67dfced37f9b5d7a2b7f80f4da7fb5716f557350.zip |
added infix type constructors
added &: infix constructor for pairs
optimization to remove redudant outer pointers
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/bug845.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug845.scala | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/neg/bug845.check b/test/files/neg/bug845.check new file mode 100644 index 0000000000..1750611993 --- /dev/null +++ b/test/files/neg/bug845.check @@ -0,0 +1,4 @@ +bug845.scala:4 error: only classes can have declared but undefined members + type Bar; + ^ +one error found diff --git a/test/files/neg/bug845.scala b/test/files/neg/bug845.scala new file mode 100644 index 0000000000..c8a2faa671 --- /dev/null +++ b/test/files/neg/bug845.scala @@ -0,0 +1,16 @@ +package test; + +object Test extends Application { + type Bar; + trait FooImpl; + + trait Bob { + def bar : Bar with FooImpl; + } + def ifn[A,B](a : A)(f : A => B) = + if (a != null) f(a) else null; + + val bob : Bob = null; + val bar = ifn(bob)(.bar); + assert(bar == null); +} |