From 17b15cfa30608ec63ee43c13bc004857c305d4c4 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 19 Aug 2024 13:51:52 -0300 Subject: [PATCH] self: fix: accept self type in function signature as a method indicator --- tl.lua | 3 +++ tl.tl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tl.lua b/tl.lua index 8f6a7346f..3732c0353 100644 --- a/tl.lua +++ b/tl.lua @@ -12391,6 +12391,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 diff --git a/tl.tl b/tl.tl index f7d17473f..1c941ded3 100644 --- a/tl.tl +++ b/tl.tl @@ -12391,6 +12391,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