diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 50f260c2d..2f307d2d6 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -101,6 +101,26 @@ local function searchFieldByLocalID(source, key, pushResult) if not fields then return end + + --Exact classes do not allow injected fields + if source.type ~= 'variable' and source.bindDocs then + ---@cast source parser.object + local uri = guide.getUri(source) + for _, src in ipairs(fields) do + if src.type == "setfield" then + local class = vm.getDefinedClass(uri, source) + if class then + for _, doc in ipairs(class:getSets(uri)) do + if vm.docHasAttr(doc, 'exact') then + return + end + end + end + end + end + end + + local hasMarkDoc = {} for _, src in ipairs(fields) do if src.bindDocs then