aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors
diff options
context:
space:
mode:
authorIntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>2022-12-11 20:41:42 +0100
committerGitHub <noreply@github.com>2022-12-11 14:41:42 -0500
commit15a6336bb40d413a7c7f140528268bb0397fdb41 (patch)
tree375e3eedd760a1172b5b303c6d67bbdbdb22045d /test/cases/compile_errors
parentcd9af0f286725c19f5dc0335fb1db1ab8cf7af0d (diff)
downloadzig-15a6336bb40d413a7c7f140528268bb0397fdb41.tar.gz
zig-15a6336bb40d413a7c7f140528268bb0397fdb41.zip
Add a helpful note when using `**` on number types. (#13871)
Diffstat (limited to 'test/cases/compile_errors')
-rw-r--r--test/cases/compile_errors/array_mult_with_number_type.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cases/compile_errors/array_mult_with_number_type.zig b/test/cases/compile_errors/array_mult_with_number_type.zig
new file mode 100644
index 0000000000..d3ec870f4e
--- /dev/null
+++ b/test/cases/compile_errors/array_mult_with_number_type.zig
@@ -0,0 +1,10 @@
+export fn entry(base: f32, exponent: f32) f32 {
+ return base ** exponent;
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :2:12: error: expected indexable; found 'f32'
+// :2:17: note: this operator multiplies arrays; use std.math.pow for exponentiation \ No newline at end of file