summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvoidiz <29259387+voidiz@users.noreply.github.com>2023-12-28 15:28:04 +0100
committerGitHub <noreply@github.com>2023-12-28 14:28:04 +0000
commit4e5afa672f502d53e931d432ec1a36bdc6e16583 (patch)
treed6adc0ee89bde75b31a400e33960cbf103fb8864 /tests
parent2dd3af937a83f02c59ad069ca6d8e41b9173aff2 (diff)
Suggest accessing field if method doesn't exist (#2977)
Diffstat (limited to 'tests')
-rw-r--r--tests/typ/compiler/dict.typ1
-rw-r--r--tests/typ/compiler/methods.typ6
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/typ/compiler/dict.typ b/tests/typ/compiler/dict.typ
index 138aa7d4..e66d8099 100644
--- a/tests/typ/compiler/dict.typ
+++ b/tests/typ/compiler/dict.typ
@@ -119,6 +119,7 @@
)
// Error: 8-15 type dictionary has no method `nonfunc`
+ // Hint: 8-15 did you mean to access the field `nonfunc`?
dict.nonfunc()
}
diff --git a/tests/typ/compiler/methods.typ b/tests/typ/compiler/methods.typ
index 692f9ab3..f3ec4434 100644
--- a/tests/typ/compiler/methods.typ
+++ b/tests/typ/compiler/methods.typ
@@ -36,6 +36,12 @@
#numbers.fun()
---
+// Error: 2:4-2:10 type content has no method `stroke`
+// Hint: 2:4-2:10 did you mean to access the field `stroke`?
+#let l = line(stroke: red)
+#l.stroke()
+
+---
// Error: 2:2-2:43 cannot mutate a temporary value
#let numbers = (1, 2, 3)
#numbers.map(v => v / 2).sorted().map(str).remove(4)