diff options
-rw-r--r-- | src/luarocks/type_check.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index 5436bde6..a3d41efc 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | --- Type-checking functions. | 1 | --- Type-checking functions. |
3 | -- Functions and definitions for doing a basic lint check on files | 2 | -- Functions and definitions for doing a basic lint check on files |
4 | -- loaded by LuaRocks. | 3 | -- loaded by LuaRocks. |
@@ -183,7 +182,9 @@ local function type_check_item(name, item, expected, context) | |||
183 | return nil, "Type mismatch on field "..context..name..": expected a string" | 182 | return nil, "Type mismatch on field "..context..name..": expected a string" |
184 | end | 183 | end |
185 | if expected ~= "string" then | 184 | if expected ~= "string" then |
186 | if not item:match("^"..expected.."$") then | 185 | if item_type ~= "string" then |
186 | return nil, "Type mismatch on field "..context..name..": expected a string, got a "..type(item) | ||
187 | elseif not item:match("^"..expected.."$") then | ||
187 | return nil, "Type mismatch on field "..context..name..": invalid value "..item.." does not match '"..expected.."'" | 188 | return nil, "Type mismatch on field "..context..name..": invalid value "..item.." does not match '"..expected.."'" |
188 | end | 189 | end |
189 | end | 190 | end |