mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 06:03:09 -05:00
Fixed missing comptime.
This commit is contained in:
parent
cac5770e3c
commit
7a16ed09ac
2 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,7 @@ const Schooner = struct {
|
||||||
mainmast_height: u32 = 95,
|
mainmast_height: u32 = 95,
|
||||||
|
|
||||||
fn scaleMe(self: *Schooner, comptime scale: u32) void {
|
fn scaleMe(self: *Schooner, comptime scale: u32) void {
|
||||||
var my_scale = scale;
|
comptime var my_scale = scale;
|
||||||
|
|
||||||
// We did something neat here: we've anticipated the
|
// We did something neat here: we've anticipated the
|
||||||
// possibility of accidentally attempting to create a
|
// possibility of accidentally attempting to create a
|
||||||
|
|
|
@ -6,3 +6,7 @@
|
||||||
< var scale: u32 = undefined;
|
< var scale: u32 = undefined;
|
||||||
---
|
---
|
||||||
> comptime var scale: u32 = undefined;
|
> comptime var scale: u32 = undefined;
|
||||||
|
76c76
|
||||||
|
< minnow.scaleMe(scale);
|
||||||
|
---
|
||||||
|
> minnow.scaleMe(32);
|
||||||
|
|
Loading…
Reference in a new issue