aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/call_from_double_ptr.zig
diff options
context:
space:
mode:
authorWill Lillis <wlillis@umass.edu>2024-07-21 03:03:23 -0400
committerGitHub <noreply@github.com>2024-07-21 00:03:23 -0700
commit9b292c094909e51718c1d37dbeb859674dd98c8a (patch)
tree82cc5238372e48270590e949eb2e7dfd17fe6e97 /test/cases/compile_errors/call_from_double_ptr.zig
parent93c546c8c9bf20b70b49546f278b4663b5c3f6d7 (diff)
downloadzig-9b292c094909e51718c1d37dbeb859674dd98c8a.tar.gz
zig-9b292c094909e51718c1d37dbeb859674dd98c8a.zip
fix: Add error notes for method calls on double pointers (#20686)
Diffstat (limited to 'test/cases/compile_errors/call_from_double_ptr.zig')
-rw-r--r--test/cases/compile_errors/call_from_double_ptr.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/cases/compile_errors/call_from_double_ptr.zig b/test/cases/compile_errors/call_from_double_ptr.zig
new file mode 100644
index 0000000000..51bb653a8a
--- /dev/null
+++ b/test/cases/compile_errors/call_from_double_ptr.zig
@@ -0,0 +1,15 @@
+const S = struct {
+ fn b() void {}
+};
+
+export fn entry(a: **S) void {
+ _ = a.b();
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// 6:10: error: no field or member function named 'b' in '*tmp.S'
+// 6:10: note: method invocation only supports up to one level of implicit pointer dereferencing
+// 6:10: note: use '.*' to dereference pointer