Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scope.bar
- import scala.util._
- import ScopeTest.Shadow._
- import scala.collection.mutable.{ListBuffer => LB}
- import scala.collection.mutable.ArrayOps
- object ScopeTest {
- object Shadow {
- def assert(boolean: Boolean): Unit = Predef.assert(boolean)
- }
- trait Buz[A] {
- type Future[T] = Vector[T]
- def a: A
- }
- val ops: ArrayOps[Int] = null
- val buffer = new StringBuffer()
- class Bar extends Buz[Int] {
- val Future: Future[String] = Vector("string")
- val buffer = new StringBuilder
- def a: Int = 42
- val bar = 2
- def foo(): Unit = {
- buffer.append(bar.toString)
- LB.empty[Int].append(bar)
- Try(1).map(arg => Vector(arg + 1)).map {
- case Vector(n) if n % 2 == 0 => n + 2
- }
- }
- }
- Predef.println(42)
- buffer.append(Vector(1))
- assert("".isEmpty)
- trait X extends Ordering[Int] {
- def comp = 3
- override def compare(x: Int, y: Int): Int = if (gteq(x, y)) 1 else 2
- }
- }
Add Comment
Please, Sign In to add comment