diff options
author | Martin Odersky <odersky@gmail.com> | 2007-03-23 13:17:26 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-03-23 13:17:26 +0000 |
commit | f0fb641bf6771b2050b08a7533d4aecf8b15dc72 (patch) | |
tree | ddc37613b57f4915779fb7794490531aabdc8543 /test/files | |
parent | 05db77de0dfea6984ddd956da8fd2fbc2e03cb00 (diff) | |
download | scala-f0fb641bf6771b2050b08a7533d4aecf8b15dc72.tar.gz scala-f0fb641bf6771b2050b08a7533d4aecf8b15dc72.tar.bz2 scala-f0fb641bf6771b2050b08a7533d4aecf8b15dc72.zip |
fixed bug1011
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug839.check | 2 | ||||
-rw-r--r-- | test/files/neg/checksensible.check | 11 | ||||
-rw-r--r-- | test/files/neg/checksensible.scala | 5 | ||||
-rw-r--r-- | test/files/pos/bug1010.scala | 15 |
4 files changed, 31 insertions, 2 deletions
diff --git a/test/files/neg/bug839.check b/test/files/neg/bug839.check index 281254ea00..ec5206effa 100644 --- a/test/files/neg/bug839.check +++ b/test/files/neg/bug839.check @@ -1,5 +1,5 @@ bug839.scala:25: error: method set cannot be accessed in object Test.this.FileImpl#treeBuilder - because its instance type (Test.this.FileImpl#treeBuilder#global.Tree)scala.Unit contains a malformed type: object Test.this.FileImpl#treeBuilder#global + because its instance type (Test.this.Global#Tree)scala.Unit contains a malformed type: Test.this.Global#Tree file.treeBuilder.set(nsc.get); ^ one error found diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 6ca462b528..442780f55c 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -31,5 +31,14 @@ checksensible.scala:16: warning: comparing values of types scala.Int and scala.N checksensible.scala:26: warning: comparing values of types scala.Unit and scala.Int using `!=' will always yield true while((c = in.read) != -1) { ^ -10 warnings found +checksensible.scala:33: warning: comparing values of types scala.Unit and scala.Boolean using `==' will always yield false + println({} == true) + ^ +checksensible.scala:35: warning: comparing a fresh object using `==' will always yield false + println(new Object == 1) + ^ +checksensible.scala:36: warning: comparing values of types scala.Int and java.lang.Object using `==' will always yield false + println(1 == (new Object)) + ^ +13 warnings found one error found diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index fa2655a241..7d0514396d 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -30,6 +30,11 @@ class Test { in.close } + println({} == true) + println("hello" == 2) + println(new Object == 1) + println(1 == (new Object)) + def isabstract: int } diff --git a/test/files/pos/bug1010.scala b/test/files/pos/bug1010.scala new file mode 100644 index 0000000000..7a1e6615e5 --- /dev/null +++ b/test/files/pos/bug1010.scala @@ -0,0 +1,15 @@ +class MailBox { + class Message + //type Message = AnyRef +} + +abstract class Actor { + private val in = new MailBox + + def send(msg: in.Message) = error("foo") + + def unstable: Actor = error("foo") + + def dubiousSend(msg: MailBox#Message): Nothing = + unstable.send(msg) // in.Message becomes unstable.Message, but that's ok since Message is a concrete type member +} |