title: Lua error attempt to index global nil value
body: <p>For a game using CoronaSDK I'm trying to implement some OOP in Lua.</p>
  
  <p>If I run the following code in the Corona simulator:</p>
  
  <pre><code>-- Terrain Sprites base
  
  local TerrBase = {}
  local TerrBase_mt = {_index = TerrBase}
  
  function TerrGrass_mt.baseAdd(a,b)
      print(a+b)
  end
  
  
  
  -- Terrain Sprites - Grass
  
  local TerrGrass = {}
  
  function TerrGrass.new()
      local grass = {}
      setmetatable(grass,TerrBase_mt)
      return grass
  end
  
  function TerrGrass.add(a,b)
      print(a+b)
  end
  
  function TerrGrass.sub(a,b)
      print(a-b)
  end
  
  function TerrGrass.mul(a,b)
      print(a*b)
  end
  
  function TerrGrass.div(a,b)
      print(a/b)
  end
  
  --
  
  local grass = TerrGrass.new()
  
  grass.add(5,7)
  </code></pre>
  
  <p>I get this message:</p>
  
  <p><a href="https://i.stack.imgur.com/nlCoz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nlCoz.png" alt="enter image description here"></a></p>
  
  <p>What is the reason for this error?</p>