aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-07-16 10:53:15 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-07-16 10:53:15 -0400
commite9a03cccf375f11aa4e0a8a3515e499c88d05cde (patch)
tree6e6cd2117a7d25684a09a24be9f30ab684b650cc /test/compile_errors.zig
parent363f4facea7fac2d6cfeab9d1d276ecd8e8e4df0 (diff)
downloadzig-e9a03cccf375f11aa4e0a8a3515e499c88d05cde.tar.gz
zig-e9a03cccf375f11aa4e0a8a3515e499c88d05cde.zip
all integer sizes are available as primitives
* fix wrong implicit cast for `@IntType` bit_count parameter. * fix incorrect docs for `@IntType` bit_count parameter. closes #1242 closes #745 closes #1240
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 58c73b8ae4..d5582b1584 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -3,6 +3,15 @@ const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
"optional pointer to void in extern struct",
+ \\comptime {
+ \\ _ = @IntType(false, @maxValue(u32) + 1);
+ \\}
+ ,
+ ".tmp_source.zig:2:40: error: integer value 4294967296 cannot be implicitly casted to type 'u32'",
+ );
+
+ cases.add(
+ "optional pointer to void in extern struct",
\\const Foo = extern struct {
\\ x: ?*const void,
\\};