mach: fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
5e8ab95a74
commit
412df4490c
1 changed files with 3 additions and 3 deletions
|
|
@ -8,15 +8,15 @@ pub fn checkApplication(comptime app_pkg: type) void {
|
||||||
|
|
||||||
// If App has no fields, it gets interpretted as '*const App' when it should be '*App'
|
// If App has no fields, it gets interpretted as '*const App' when it should be '*App'
|
||||||
// This gives a more useful compiler error.
|
// This gives a more useful compiler error.
|
||||||
switch(@typeInfo(App)) {
|
switch (@typeInfo(App)) {
|
||||||
.Struct => |app| {
|
.Struct => |app| {
|
||||||
if(app.fields.len == 0) {
|
if (app.fields.len == 0) {
|
||||||
@compileError("App must contain fields. Example: '_unused: i32,'");
|
@compileError("App must contain fields. Example: '_unused: i32,'");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
@compileError("App must be a struct type. Found:" ++ @typeName(App));
|
@compileError("App must be a struct type. Found:" ++ @typeName(App));
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@hasDecl(App, "init")) {
|
if (@hasDecl(App, "init")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue