summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/definition/method.lua26
-rw-r--r--test/diagnostics/common.lua4
2 files changed, 28 insertions, 2 deletions
diff --git a/test/definition/method.lua b/test/definition/method.lua
index aa7aacdc..e4368edb 100644
--- a/test/definition/method.lua
+++ b/test/definition/method.lua
@@ -29,3 +29,29 @@ end
function mt:<!m4!>()
end
]]
+
+TEST [[
+local mt
+
+function mt:f()
+ self.<!x!> = 1
+end
+
+mt.<?x?>
+]]
+
+TEST [[
+function G:f()
+ self.<!x!> = 1
+end
+
+G.<?x?>
+]]
+
+TEST [[
+function G.H:f()
+ self.<!x!> = 1
+end
+
+G.H.<?x?>
+]]
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index 56ad0d59..2a9cefe0 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -792,7 +792,7 @@ local mt2 = {}
---@type Foo
local v
print(v.field1 + 1)
-print(v.<!field2!> + 1)
+print(v.field2 + 1)
print(v.<!field3!> + 1)
print(v:method1())
print(v.method2())
@@ -801,7 +801,7 @@ print(v:<!method3!>())
---@type Bar
local v2
print(v2.field1 + 1)
-print(v2.<!field2!> + 1)
+print(v2.field2 + 1)
print(v2.<!field3!> + 1)
print(v2.field4 + 1)
print(v2:method1())