summaryrefslogblamecommitdiff
path: root/test/files/neg/checksensible.check
blob: 112d101076baf5c9901d83b6fa2e5ed2c323a16f (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                                                     

            
                                                                                                                                    

                      
                                                                                                                                    

                       
                                                                                                                     

                       
                                                                                                                           

                     
                                                                                                                       

                    
                                                                                            

                                      
                                                                                            

                                   
                                                                                           

                                       

                                                                                                                      
                  



                                                                                                                          

                     
                                                                                            

                          
                                                                                                                            

                            






                                                                                                                       
               
checksensible.scala:1: error: class Test needs to be abstract, since method isabstract is not defined
class Test {
^
checksensible.scala:3: warning: comparing values of types scala.Ordered[scala.Unit] and scala.Unit using `>' will always yield false
  println((c = 1) > 0)
                  ^
checksensible.scala:4: warning: comparing values of types scala.Ordered[scala.Unit] and scala.Unit using `<=' will always yield true
  println((c = 1) <= 0)
                  ^
checksensible.scala:5: warning: comparing values of types scala.Unit and scala.Int using `==' will always yield false
  println((c = 1) == 0)
                  ^
checksensible.scala:7: warning: comparing values of types scala.Int and java.lang.String using `==' will always yield false
  println(1 == "abc")
            ^
checksensible.scala:8: warning: comparing values of types scala.Int and scala.Boolean using `!=' will always yield true
  println(1 != true)
            ^
checksensible.scala:10: warning: comparing a fresh object using `==' will always yield false
  println(((x: int) => x + 1) == null)
                              ^
checksensible.scala:11: warning: comparing a fresh object using `==' will always yield false
  println(new Object == new Object)
                     ^
checksensible.scala:12: warning: comparing a fresh object using `!=' will always yield true
  println(new Array(1) != new Array(1))
                       ^
checksensible.scala:15: warning: comparing values of types scala.Int and scala.Null using `==' will always yield false
  if (foo.length == null) //  == 0 makes more sense, but still
                 ^
checksensible.scala:24: warning: comparing values of types scala.Unit and scala.Int using `!=' will always yield true
    while ((c = in.read) != -1)
                         ^
checksensible.scala:30: warning: comparing values of types scala.Unit and scala.Boolean using `==' will always yield false
  println({} == true)
             ^
checksensible.scala:32: warning: comparing a fresh object using `==' will always yield false
  println(new Object == 1)
                     ^
checksensible.scala:33: warning: comparing values of types scala.Int and java.lang.Object using `==' will always yield false
  println(1 == (new Object))
            ^
checksensible.scala:37: warning: comparing values of types scala.Int and scala.Unit using `!=' will always yield true
  println(1 != println)
            ^
checksensible.scala:38: warning: comparing values of types scala.Int and scala.Symbol using `!=' will always yield true
  println(1 != 'sym)
            ^
15 warnings found
one error found