parameters: (typingctx, val)
return_statement: return sig, codegen
docstring: Typing trick to cast Optional[T] to T
docstring_summary: Typing trick to cast Optional[T] to T
docstring_tokens: Typing trick to cast Optional [ T ] to T
function: def _nonoptional(typingctx, val):
      """Typing trick to cast Optional[T] to T
      """
      if not isinstance(val, types.Optional):
          raise TypeError('expected an optional')
  
      def codegen(context, builder, sig, args):
          context.nrt.incref(builder, sig.return_type, args[0])
          return args[0]
  
      casted = val.type
      sig = casted(casted)
      return sig, codegen
function_tokens: def _nonoptional ( typingctx , val ) : if not isinstance ( val , types . Optional ) : raise TypeError ( 'expected an optional' ) def codegen ( context , builder , sig , args ) : context . nrt . incref ( builder , sig . return_type , args [ 0 ] ) return args [ 0 ] casted = val . type sig = casted ( casted ) return sig , codegen