title: Errors inside enum function
body: <p>I have an enum that is set up like this:</p>
  
  <pre><code>enum Calculators {
  
      case RECTANGLE
      case CIRCLE
      case TRIANGLE
      case TRAPEZOID
      case CUBE
      case CONE
      case SPHERE
      case CYLINDER
      case ASPHALT
      case TACK_SEAL_COAT
      case ASPHALT_YIELD
      case SIDEWALK
      case CONCRETE_DECK_SEALER
      case CHIP_SEAL
      case AGGREGATE_STOCK_PILE
      case BACKFILL
      case SALT_STOCK_PILE
      case SALT_SPREADER_CALIBRATION
      case ROAD_SALT_APPLICATION
  
      static let groups = [[RECTANGLE, CIRCLE, TRIANGLE, TRAPEZOID],
                         [CUBE, CONE, SPHERE, CYLINDER],
                         [ASPHALT, TACK_SEAL_COAT, ASPHALT_YIELD, SIDEWALK, CONCRETE_DECK_SEALER, CHIP_SEAL, AGGREGATE_STOCK_PILE, BACKFILL],
                         [SALT_STOCK_PILE, SALT_SPREADER_CALIBRATION, ROAD_SALT_APPLICATION]]
  
      func getCalculator(category: Int, row: Int) -&gt; Calculators {
          if let calculator =  Calculators.groups[category][row] {
              return calculator
          } else {
              return Calculators.UNDEFINED
          }
      }
  }
  </code></pre>
  
  <p>My idea is that I will pass in the category of calculator that I want, followed by the specific calculator and it will return the correct enum, all based on what row was selected in a TableView.</p>
  
  <p>The problem is that I'm faced with a confusing error. This first error is on the <code>if let calculator</code> line. The error reads <code>Enum case 'Some' not found in type 'Calculators'</code>. I'm not sure why it's looking for this.</p>
  
  <p>What does this error mean and how can I resove it?</p>