class TestCase::Scope {
  
  static method switch : int () {
    
    # switch condition has own scope
    {
      switch (my $num = 1) {
        
      }
      
      my $num = 2;
      
      unless ($num == 2) {
        return 0;
      }
    }
    
    # Objects in condition part is destroyed.
    {
      switch ((my $object = Int->new(1), my $num = 1, $num)) {
        
      }
    }
    
    return 1;
  }
  
  static method while : int () {
    
    # while condition has own scope
    {
      while (my $num = 0) {
        
      }
      
      my $num = 2;
      
      unless ($num == 2) {
        return 0;
      }
    }
    
    # Objects in condition part is destroyed.
    {
      while ((my $object = Int->new(1), my $num = 0, $num)) {
        
      }
    }
    
    return 1;
  }
  
  static method if : int () {
    
    # while condition has own scope
    {
      if (my $num = 0) {
        
      }
      
      my $num = 2;
      
      unless ($num == 2) {
        return 0;
      }
    }
    
    # Objects in condition part is destroyed.
    {
      if ((my $object = Int->new(1), my $num = 0, $num)) {
        
      }
    }
    
    return 1;
  }
  
  static method extra : int () {
    
    {
      if (0) {
        "";
      }
    }
    
    return 1;
  }
}