title: How to add an assertion for a specific condition with a return type
body: <p>I have something like this in my code. Now the method is suppose to return an enum type.
  However not all code paths return a value. I would like to resolve this issue and at the same time I want the debugger to alert me that (ie) assertion that no enum type can be returned in case it goes into else (the 3rd condition in the code). Normally I would add another enum type for the else condition and check the returned value but I wanted to know if there was a better way doing this.</p>
  
  <pre><code>        private enumType AdjustType(someo_object q)
          {
              if(q.val.Equals("M"))
              {
                  return enumType.FirstType;
              }
              else if (q.val.Equals("N"))
              {
                  return enumType.SecondType;
              }
              else
              {
                  return null; //This isnt allowed - I would like something like an assertion here
              }
          }
  </code></pre>