diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-05 15:24:01 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-05 15:24:01 +0300 |
commit | 5f069526966ae37319ba745644a43e0cf64ad62c (patch) | |
tree | f9515b3654d2e63639c3fef82666e884b1862d90 | |
parent | fa60a09a3a522f9f3b58f084ab8efdb35a04e7df (diff) | |
download | luarocks-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.lua | 7 |
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 | ||
235 | local function mkfield(context, field) | 235 | local 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 | ||
240 | end | 243 | end |
241 | 244 | ||
242 | --- Type check the contents of a table. | 245 | --- Type check the contents of a table. |