return function(b,w)local D={}for w,g in ipairs(w)do local d=newproxy(true)local S=("\037\115\046\037\115"):format(b,g);(getmetatable(d)).__tostring=function()return S end D[g]=d end setmetatable(D,{__index=function(w,D)error(("\037\113 \105\115 \110\111\116 \097 \118\097\108\105\100 \109\101\109\098\101\114 \111\102 \116\104\101 \101\110\117\109 \037\115"):format(tostring(D),b),2)end,__newindex=function()error(("\084\104\101 \101\110\117\109 \037\115 \099\097\110\110\111\116 \098\101 \109\117\116\097\116\101\100\046"):format(b),2)end})return D end
return function(enumName, enumValues)
	local enum = {}

	for _, valueName in ipairs(enumValues) do
		local item = newproxy(true)
		local fullName = ("%s.%s"):format(enumName, valueName)

		getmetatable(item).__tostring = function()
			return fullName
		end

		enum[valueName] = item
	end

	setmetatable(enum, {
		__index = function(_, key)
			error(("%q is not a valid member of the enum %s"):format(tostring(key), enumName), 2)
		end,
		__newindex = function()
			error(("The enum %s cannot be mutated."):format(enumName), 2)
		end,
	})

	return enum
end