From de25b4d19ce5337a8b1b094a1c936b8533e02f01 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Tue, 2 Apr 2024 23:00:56 +0530 Subject: [PATCH] fix: uncomparable metatables TypeError --- lib/option.luau | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/option.luau b/lib/option.luau index c571444..440934e 100644 --- a/lib/option.luau +++ b/lib/option.luau @@ -33,16 +33,14 @@ function Option.new(val: T?) end, __lt = function(self: Option, other: Option): boolean if self:isSome() and other:isSome() then - -- FIXME: TypeError: Type T cannot be compared with < because it has no metatable - return (self._optValue :: T) < (other._optValue :: T) + return (self._optValue :: any) < (other._optValue :: any) end return false end, __le = function(self: Option, other: Option): boolean if self:isSome() and other:isSome() then - -- FIXME: TypeError: Type T cannot be compared with <= because it has no metatable - return (self._optValue :: T) <= (other._optValue :: T) + return (self._optValue :: any) <= (other._optValue :: any) end return false