From 813ad75a7f87d96bd372e7c2eca6a677009722a2 Mon Sep 17 00:00:00 2001 From: Hisham Date: Thu, 28 Jul 2016 17:24:25 -0300 Subject: Fix field name building in type_check.lua Port fix by @mpeterv in 5f069526966ae37319ba745644a43e0cf64ad62c --- src/luarocks/core/type_check.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/luarocks/core/type_check.lua b/src/luarocks/core/type_check.lua index a2e14efd..1822312b 100644 --- a/src/luarocks/core/type_check.lua +++ b/src/luarocks/core/type_check.lua @@ -134,9 +134,12 @@ end local function mkfield(context, field) if context == "" then - return field + return tostring(field) + elseif type(field) == "string" then + return context.."."..field + else + return context.."["..tostring(field).."]" end - return context.."."..field end --- Type check the contents of a table. -- cgit v1.2.3-55-g6feb