mirror of
https://github.com/ziglang/zig.git
synced 2024-12-03 10:28:48 +00:00
more test coverage
This commit is contained in:
parent
c982077156
commit
e3857a361c
@ -1467,6 +1467,18 @@ fn function_with_return_type_type() {
|
||||
".tmp_source.zig:4:5: note: unable to evaluate this expression at compile time",
|
||||
".tmp_source.zig:3:32: note: required to be compile-time function because of return type 'type'");
|
||||
|
||||
add_compile_fail_case("non pure function required to be pure", R"SOURCE(
|
||||
var a: i32 = 0;
|
||||
|
||||
fn foo() {
|
||||
@setFnStaticEval(this, true);
|
||||
a = 1;
|
||||
}
|
||||
)SOURCE", 3,
|
||||
".tmp_source.zig:4:1: error: failed to evaluate function at compile time",
|
||||
".tmp_source.zig:6:5: note: unable to evaluate this expression at compile time",
|
||||
".tmp_source.zig:5:5: note: required to be compile-time function here");
|
||||
|
||||
add_compile_fail_case("bogus method call on slice", R"SOURCE(
|
||||
fn f(m: []const u8) {
|
||||
m.copy(u8, self.list.items[old_len...], m);
|
||||
|
Loading…
Reference in New Issue
Block a user