Skip to content

Commit 7d674d5

Browse files
ThreeFxifreund
authored andcommitted
build: Allow comptime_int in OptionsStep.addOption
1 parent b12992c commit 7d674d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/std/build/OptionsStep.zig

+3
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ fn printLiteral(out: anytype, val: anytype, indent: u8) !void {
171171
.Void,
172172
.Bool,
173173
.Int,
174+
.ComptimeInt,
174175
.Float,
175176
.Null,
176177
=> try out.print("{any}", .{val}),
@@ -302,6 +303,7 @@ test "OptionsStep" {
302303
options.addOption(usize, "option1", 1);
303304
options.addOption(?usize, "option2", null);
304305
options.addOption(?usize, "option3", 3);
306+
options.addOption(comptime_int, "option4", 4);
305307
options.addOption([]const u8, "string", "zigisthebest");
306308
options.addOption(?[]const u8, "optional_string", null);
307309
options.addOption([2][2]u16, "nested_array", nested_array);
@@ -314,6 +316,7 @@ test "OptionsStep" {
314316
\\pub const option1: usize = 1;
315317
\\pub const option2: ?usize = null;
316318
\\pub const option3: ?usize = 3;
319+
\\pub const option4: comptime_int = 4;
317320
\\pub const string: []const u8 = "zigisthebest";
318321
\\pub const optional_string: ?[]const u8 = null;
319322
\\pub const nested_array: [2][2]u16 = [2][2]u16 {

0 commit comments

Comments
 (0)