{"record":{"id":"d623daad03602acc","repo":"OpenRA/OpenRA","slug":"wangle-does-not-define-a-member-key","errorCode":null,"errorMessage":"WAngle does not define a member '{key}'","messagePattern":"WAngle does not define a member '(.+?)'","errorType":"exception","errorClass":"LuaException","httpStatus":null,"severity":"error","filePath":"OpenRA.Game/WAngle.cs","lineNumber":268,"sourceCode":"\t\t\t\t$\"({left.WrappedClrType().Name}, {right.WrappedClrType().Name})\");\n\t\t}\n\n\t\tpublic LuaValue Equals(LuaRuntime runtime, LuaValue left, LuaValue right)\n\t\t{\n\t\t\tif (!left.TryGetClrValue(out WAngle a) || !right.TryGetClrValue(out WAngle b))\n\t\t\t\treturn false;\n\n\t\t\treturn a == b;\n\t\t}\n\n\t\tpublic LuaValue this[LuaRuntime runtime, LuaValue key]\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tswitch (key.ToString())\n\t\t\t\t{\n\t\t\t\t\tcase \"Angle\": return Angle;\n\t\t\t\t\tdefault: throw new LuaException($\"WAngle does not define a member '{key}'\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tset => throw new LuaException(\"WAngle is read-only. Use Angle.New to create a new value\");\n\t\t}\n\n\t\tpublic LuaValue ToString(LuaRuntime runtime) => ToString();\n\n\t\t#endregion\n\t}\n}\n","sourceCodeStart":250,"sourceCodeEnd":280,"githubUrl":"https://github.com/OpenRA/OpenRA/blob/a520984d91eda9de48a62b1d15c1e3bad0d4fb1a/OpenRA.Game/WAngle.cs#L250-L280","documentation":"Lua scripting error from the WAngle indexer getter. WAngle only exposes the `\"Angle\"` member to Lua scripts; any other key passed via `wangle[key]` hits the default case and throws a LuaException naming the unknown member.","triggerScenarios":"A Lua expression like `wangle.Degrees`, `wangle.Radians`, or `wangle[\"foo\"]` — any member access other than `wangle.Angle`.","commonSituations":"Scripts guessing member names (e.g. assuming `Degrees` exists) or copy-pasted from documentation for a different type. Also typos in the key string.","solutions":["Use the only valid member: `wangle.Angle`.","Check the OpenRA scripting docs / WAngle.cs to confirm the exposed members before accessing.","If you need a different representation, derive it from `wangle.Angle` yourself."],"exampleFix":"-- before\nlocal d = wangle.Degrees\n-- after\nlocal d = wangle.Angle","handlingStrategy":"type-guard","validationCode":"local valid = { Angle = true }\nif valid[key] then\n    v = wangle.Angle\nelse\n    error(\"WAngle has no member \" .. tostring(key))\nend","typeGuard":null,"tryCatchPattern":"local ok, val = pcall(function() return wangle.Angle end)\nif ok then use(val) else reportUnknownMember(wangle, key) end","preventionTips":["Only access `wangle.Angle`; check WAngle.cs for the canonical member list.","Avoid guessing member names from other types' docs.","Cache the member name as a constant to avoid typos."],"tags":["openra","lua","scripting","wangle","member-access"],"backgroundTag":null,"analyzedSha":"a520984d91eda9de48a62b1d15c1e3bad0d4fb1a","analyzedAt":"2026-08-13T15:30:14.787Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}