Question: I am trying to have a switch statement inside of an if statement checking integers

```
if variable <= 3 {
    // code
    switch variable {
    case 0: 
        println("0 case")
    case 1: 
        println("1 case")
    case 2: 
        println("2 case")
    case 3: 
        println("3 case")
    default:
        println("error")
    }
}

```

But I am getting an error for each case

```
 Binary operator '~=' cannot be applied to operands of type 'Int' and 'Int?'

```

I do not understand why this wouldn't work.

Answer: 
`3` is an `Int` but `variable` is an `Int?` (an optional `Int`). You have to unwrap it.

For example, you can check if it's `nil` in the `if` statement. If it's not, then it's safe to force-unwrap (with `!`) inside the scope of that conditional:

One of many possible approaches:

```
if variable <= 3 && variable != nil {
    // code
    switch variable! {
    case 0:
        println("0 case")
    case 1:
        println("1 case")
    case 2:
        println("2 case")
    case 3:
        println("3 case")
    default:
        println("error")
    }
}

```
var variable : `Int`? will not work 

```
var variable = 2
//var variable : Int? // will not work

if variable <= 3 {
// code
switch variable {
case 0:
    println("0 case")
case 1:
    println("1 case")
case 2:
    println("2 case")
case 3:
    println("3 case")
default:
    println("error")
}
}

```