Guest User

Untitled

a guest
Feb 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. package scope.bar
  2.  
  3. import scala.util._
  4. import ScopeTest.Shadow._
  5. import scala.collection.mutable.{ListBuffer => LB}
  6. import scala.collection.mutable.ArrayOps
  7.  
  8. object ScopeTest {
  9.  
  10. object Shadow {
  11. def assert(boolean: Boolean): Unit = Predef.assert(boolean)
  12. }
  13.  
  14. trait Buz[A] {
  15. type Future[T] = Vector[T]
  16. def a: A
  17. }
  18. val ops: ArrayOps[Int] = null
  19.  
  20. val buffer = new StringBuffer()
  21.  
  22. class Bar extends Buz[Int] {
  23. val Future: Future[String] = Vector("string")
  24. val buffer = new StringBuilder
  25. def a: Int = 42
  26. val bar = 2
  27. def foo(): Unit = {
  28. buffer.append(bar.toString)
  29. LB.empty[Int].append(bar)
  30. Try(1).map(arg => Vector(arg + 1)).map {
  31. case Vector(n) if n % 2 == 0 => n + 2
  32. }
  33. }
  34. }
  35. Predef.println(42)
  36. buffer.append(Vector(1))
  37. assert("".isEmpty)
  38. trait X extends Ordering[Int] {
  39. def comp = 3
  40. override def compare(x: Int, y: Int): Int = if (gteq(x, y)) 1 else 2
  41. }
  42. }
Add Comment
Please, Sign In to add comment