summaryrefslogtreecommitdiff
path: root/test/files/run/bug457.scala
blob: ae53ea8e1a3d6af6b3866c13be788d73fabe45e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
object Test {

  def method1() = {
    val x = "Hello, world";
    val y = 100;

     y match {
       case _: Int
        if (x match { case t => t.trim().length() > 0 }) =>
          false;
       case _ => true;
    }
  }

  def method2(): scala.Boolean = {
    val x: String = "Hello, world";
    val y: scala.Int = 100;
    {
      var temp1: scala.Int = y;
      var result: scala.Boolean = false;
      if (
        {
          var result1: scala.Boolean = true;
          if (y == 100)
            result1
          else
            throw new MatchError("crazybox.scala, line 11")
        } && (y > 90)
      )
        result
      else
        throw new MatchError("crazybox.scala, line 9")
    }
  }

  def main(args: Array[String]): Unit = {
    method1();
    method2();
  }

}