From ec7e2d266eed131145a62192697885c6c2005d0d Mon Sep 17 00:00:00 2001 From: Vurv <56230599+Vurv78@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:17:15 -0800 Subject: [PATCH] Change preprocessor duplicate error to warning (#2869) * Change preprocessor duplicate error to warning * Fix differing types oversight --- lua/entities/gmod_wire_expression2/base/preprocessor.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/base/preprocessor.lua b/lua/entities/gmod_wire_expression2/base/preprocessor.lua index ab989d0915..38e4c46334 100644 --- a/lua/entities/gmod_wire_expression2/base/preprocessor.lua +++ b/lua/entities/gmod_wire_expression2/base/preprocessor.lua @@ -200,7 +200,11 @@ local function handleIO(name) for i, key in ipairs(retval[1]) do if ports[3][key] then - self:Error("Directive (@" .. name .. ") contains multiple definitions of the same variable", columns[i]) + if ports[3][key] ~= retval[2][i] then + self:Error("Directive (@" .. name .. ") contains multiple definitions of the same variable with differing types", columns[i]) + else + self:Warning("Directive (@" .. name .. ") contains multiple definitions of the same variable", columns[i]) + end else local index = #ports[1] + 1 ports[1][index] = key -- Index: Name