mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-09 07:08:59 +00:00
add test for error for redefinition of struct
This commit is contained in:
parent
50357dad45
commit
4e52281142
2 changed files with 5 additions and 1 deletions
|
|
@ -1066,7 +1066,6 @@ static TypeTableEntry *analyze_cast_expr(CodeGen *g, ImportTableEntry *import, B
|
||||||
enum LValPurpose {
|
enum LValPurpose {
|
||||||
LValPurposeAssign,
|
LValPurposeAssign,
|
||||||
LValPurposeAddressOf,
|
LValPurposeAddressOf,
|
||||||
LValPurposeNotLVal,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static TypeTableEntry *analyze_lvalue(CodeGen *g, ImportTableEntry *import, BlockContext *block_context,
|
static TypeTableEntry *analyze_lvalue(CodeGen *g, ImportTableEntry *import, BlockContext *block_context,
|
||||||
|
|
|
||||||
|
|
@ -867,6 +867,11 @@ fn f() {
|
||||||
)SOURCE", 2,
|
)SOURCE", 2,
|
||||||
".tmp_source.zig:5:6: error: no member named 'foo' in 'A'",
|
".tmp_source.zig:5:6: error: no member named 'foo' in 'A'",
|
||||||
".tmp_source.zig:6:16: error: no member named 'bar' in 'A'");
|
".tmp_source.zig:6:16: error: no member named 'bar' in 'A'");
|
||||||
|
|
||||||
|
add_compile_fail_case("redefinition of struct", R"SOURCE(
|
||||||
|
struct A { x : i32, }
|
||||||
|
struct A { y : i32, }
|
||||||
|
)SOURCE", 1, ".tmp_source.zig:3:1: error: redefinition of 'A'");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_compiler_invocation(TestCase *test_case) {
|
static void print_compiler_invocation(TestCase *test_case) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue