mirror of
https://github.com/CompeyDev/rusty-luau.git
synced 2024-12-12 04:40:40 +00:00
fix: uncomparable metatables TypeError
This commit is contained in:
parent
353ce041ea
commit
de25b4d19c
1 changed files with 2 additions and 4 deletions
|
@ -33,16 +33,14 @@ function Option.new<T>(val: T?)
|
|||
end,
|
||||
__lt = function<T>(self: Option<T>, other: Option<T>): 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<T>(self: Option<T>, other: Option<T>): 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
|
||||
|
|
Loading…
Reference in a new issue