aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-07-05 15:24:01 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-07-05 15:24:01 +0300
commit5f069526966ae37319ba745644a43e0cf64ad62c (patch)
treef9515b3654d2e63639c3fef82666e884b1862d90
parentfa60a09a3a522f9f3b58f084ab8efdb35a04e7df (diff)
downloadluarocks-5f069526966ae37319ba745644a43e0cf64ad62c.tar.gz
luarocks-5f069526966ae37319ba745644a43e0cf64ad62c.tar.bz2
luarocks-5f069526966ae37319ba745644a43e0cf64ad62c.zip
Fix field name building in type_check.lua
Use 'parent[field]' notation for non-string fields.
-rw-r--r--src/luarocks/type_check.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua
index 82763401..63c59ca2 100644
--- a/src/luarocks/type_check.lua
+++ b/src/luarocks/type_check.lua
@@ -234,9 +234,12 @@ end
234 234
235local function mkfield(context, field) 235local function mkfield(context, field)
236 if context == "" then 236 if context == "" then
237 return field 237 return tostring(field)
238 elseif type(field) == "string" then
239 return context.."."..field
240 else
241 return context.."["..tostring(field).."]"
238 end 242 end
239 return context.."."..field
240end 243end
241 244
242--- Type check the contents of a table. 245--- Type check the contents of a table.