assign :: (Throws (Located GeneratorError) e, CodeGen val) => LValue :~ TypeAnn -> val -> GenerateJvm e ()
assign e@(content -> LVariable name) value = do
  prog <- gets programName
  symbol <- getSymbol name (getActualSymbols e)
  let t = getJvmType $ symbolType symbol
  if symbolContext symbol == Outside
    then do
      liftG $ J.aload_ I0
      generate value
      let nt = NameType (toBS name) t
      liftG $ J.putField (toBS prog) nt
    else do
      generate value
      instruction <- getInstruction "variable type" t tiStore
      liftG $ J.i0 $ instruction (fromIntegral $ symbolIndex symbol + 1)
assign :: (Throws (Located GeneratorError) e, CodeGen val) => LValue :~ TypeAnn -> val -> GenerateJvm e ()
assign e@(content -> LVariable name) value = do
  prog <- gets programName
  symbol <- getSymbol name (getActualSymbols e)
  let t = getJvmType $ symbolType symbol
  if symbolContext symbol == Outside
    then do
      liftG $ J.aload_ I0
      generate value
      let nt = NameType (toBS name) t
      liftG $ J.putField (toBS prog) nt
    else do
      generate value
      instruction <- getInstruction "variable type" t tiStore
      liftG $ J.i0 $ instruction (fromIntegral $ symbolIndex symbol + 1)
assign e@(content -> LVariable name) value = do
  prog <- gets programName
  symbol <- getSymbol name (getActualSymbols e)
  let t = getJvmType $ symbolType symbol
  if symbolContext symbol == Outside
    then do
      liftG $ J.aload_ I0
      generate value
      let nt = NameType (toBS name) t
      liftG $ J.putField (toBS prog) nt
    else do
      generate value
      instruction <- getInstruction "variable type" t tiStore
      liftG $ J.i0 $ instruction (fromIntegral $ symbolIndex symbol + 1)