Skip to content

Commit

Permalink
Rename to value template.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed Aug 26, 2024
1 parent 9faa327 commit 2eee654
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/sema.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ pub fn reserveTemplate(c: *cy.Chunk, node: *ast.TemplateDecl) !*cy.sym.Template
template_t = .ct_func;

if (ast.findAttr(node.getAttrs(), .host) != null) {
return c.reportError("A template function can not be binded to a `@host` function. Consider invoking a `@host` function in the template body instead.", @ptrCast(node));
return c.reportError("A value template can not be binded to a `@host` function. Consider invoking a `@host` function in the template body instead.", @ptrCast(node));
}
},
else => {
Expand Down
6 changes: 3 additions & 3 deletions test/behavior_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ if (!aot) {
run.case("functions/overload.cy");
run.case("functions/read_capture_local_error.cy");
run.case("functions/static.cy");
run.case("functions/template_ct_func.cy");
run.case("functions/template_ct_func_host_error.cy");
run.case("functions/template_ct_func_throw_error.cy");
run.case("functions/template_functions.cy");
run.case("functions/template_value.cy");
run.case("functions/template_value_host_error.cy");
run.case("functions/template_value_throw_error.cy");
// run.case("functions/void_param_error.cy");

run.case("memory/arc_cases.cy");
Expand Down
9 changes: 0 additions & 9 deletions test/functions/template_ct_func_host_error.cy

This file was deleted.

File renamed without changes.
9 changes: 9 additions & 0 deletions test/functions/template_value_host_error.cy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@host func GetType[ID String] type

--cytest: error
--CompileError: A value template can not be binded to a `@host` function. Consider invoking a `@host` function in the template body instead.
--
--main:1:7:
--@host func GetType[ID String] type
-- ^
--

0 comments on commit 2eee654

Please sign in to comment.