diff --git a/anselme/ast/Struct.lua b/anselme/ast/Struct.lua index b7da15b..51712fa 100644 --- a/anselme/ast/Struct.lua +++ b/anselme/ast/Struct.lua @@ -113,7 +113,7 @@ Struct = ast.abstract.Runtime { if v ~= nil then return v else - return Nil:new() + error(("key %q is undefined in %s"):format(key:format(), self.type), 0) end end, get_strict = function(self, key) diff --git a/ideas.md b/ideas.md index 38b26bd..d265bab 100644 --- a/ideas.md +++ b/ideas.md @@ -25,10 +25,6 @@ Issue: dispatch is decided before evaluating default values. Multiline string and comments? ---- - -Error on undefined struct/table key? I copied the Lua behavior but maybe not useful here. - # Can be done later Translation.