From 23133f523016aed8670fca2ca65d4ef4963d7510 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 17d0e6bfc..c6aaae74e 100644 --- a/tl.lua +++ b/tl.lua @@ -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 diff --git a/tl.tl b/tl.tl index 313503251..3b31b4fd5 100644 --- a/tl.tl +++ b/tl.tl @@ -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