Skip to content

Commit

Permalink
self: fix: accept self type in function signature as a method indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Aug 19, 2024
1 parent bc64ede commit 23133f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12393,6 +12393,9 @@ self:expand_type(node, values, elements) })
local function ensure_is_method_self(typ, fargs)
assert(typ.declname)
local selfarg = fargs[1]
if selfarg.typename == "self" then
return true
end
if not (selfarg.typename == "nominal") then
return false
end
Expand Down
3 changes: 3 additions & 0 deletions tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -12393,6 +12393,9 @@ do
local function ensure_is_method_self(typ: RecordLikeType, fargs: {Type}): boolean
assert(typ.declname)
local selfarg = fargs[1]
if selfarg is SelfType then
return true
end
if not selfarg is NominalType then
return false
end
Expand Down

0 comments on commit 23133f5

Please sign in to comment.