summaryrefslogblamecommitdiff
path: root/test/files/run/repl-bare-expr.check
blob: bdf8842bb0b1d7f1168e54d3bedd12b2b8f99fa4 (plain) (tree)
1
2
3
4
5
6
7
8
9
 
            
                                                                                                                                    

           


                
                                                                                                                                      

                





                                                                                                           
                                                                                                                                    

                                                                                                           
                                                                                                                                    

                                                                                                           
                                                                                                                                    

                                                                                                           
                                                                                                                                    

                                                                                                           
                  






                                                                                                    
                     








                                                     
            
scala> 2 ; 3
<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
       2 ;;
       ^
res0: Int = 3

scala> { 2 ; 3 }
<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses
       { 2 ; 3 }
         ^
res1: Int = 3

scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
  1 +
  2 +
  3 } ; bippy+88+11
<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
       5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
       ^
<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
       5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
           ^
<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
       5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
                                  ^
<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
       5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
                                                                                         ^
defined object Cow
defined class Moo
bippy: Int
res2: Int = 105

scala> 

scala> object Bovine { var x: List[_] = null } ; case class Ruminant(x: Int) ; bippy * bippy * bippy
defined object Bovine
defined class Ruminant
res3: Int = 216

scala> Bovine.x = List(Ruminant(5), Cow, new Moo)
Bovine.x: List[Any] = List(Ruminant(5), Cow, Moooooo)

scala> Bovine.x
res4: List[Any] = List(Ruminant(5), Cow, Moooooo)

scala> :quit