Skip to content

Commit

Permalink
Fix field name building in type_check.lua
Browse files Browse the repository at this point in the history
Use 'parent[field]' notation for non-string fields.
  • Loading branch information
mpeterv committed Jul 5, 2016
1 parent fa60a09 commit 5f06952
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/luarocks/type_check.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,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.
Expand Down

0 comments on commit 5f06952

Please sign in to comment.