mirror of
https://github.com/CompeyDev/rusty-luau.git
synced 2024-12-12 12:50: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,
|
end,
|
||||||
__lt = function<T>(self: Option<T>, other: Option<T>): boolean
|
__lt = function<T>(self: Option<T>, other: Option<T>): boolean
|
||||||
if self:isSome() and other:isSome() then
|
if self:isSome() and other:isSome() then
|
||||||
-- FIXME: TypeError: Type T cannot be compared with < because it has no metatable
|
return (self._optValue :: any) < (other._optValue :: any)
|
||||||
return (self._optValue :: T) < (other._optValue :: T)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
__le = function<T>(self: Option<T>, other: Option<T>): boolean
|
__le = function<T>(self: Option<T>, other: Option<T>): boolean
|
||||||
if self:isSome() and other:isSome() then
|
if self:isSome() and other:isSome() then
|
||||||
-- FIXME: TypeError: Type T cannot be compared with <= because it has no metatable
|
return (self._optValue :: any) <= (other._optValue :: any)
|
||||||
return (self._optValue :: T) <= (other._optValue :: T)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue