zig/test
Andrew Kelley ab8f8465a3 stage2: fix deletion of Decls that get re-referenced
When scanDecls happens, we create stub Decl objects that
have not been semantically analyzed. When they get referenced,
they get semantically analyzed.

Before this commit, when they got unreferenced, they were completely
deleted, including deleted from the containing Namespace.

However, if the update did not cause the containing Namespace to get
deleted, for example, if `std.builtin.ExportOptions` is no longer
referenced, but `std.builtin` is still referenced, and then `ExportOptions`
gets referenced again, the Namespace would be incorrectly missing the
Decl, so we get an incorrect "no such member" error.

The solution is to, when dealing with a no longer referenced Decl
objects during an update, clear them to the state they would be in
on a fresh scanDecl, rather than completely deleting them.
2021-05-18 12:35:36 -07:00
..
behavior behavior tests: re-enable commented out test 2021-05-17 16:09:20 -07:00
src tests: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
stage1/c_abi stage1: Widen non byte-sized atomic loads/stores 2021-05-14 15:16:24 -04:00
stage2 stage2: fix deletion of Decls that get re-referenced 2021-05-18 12:35:36 -07:00
standalone std: @import("builtin").StackTrace -> std.builtin.StackTrace 2021-05-17 14:36:51 -07:00
assemble_and_link.zig update std lib to new Target API 2020-02-28 14:51:54 -05:00
behavior.zig move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
cli.zig std: @import("builtin").StackTrace -> std.builtin.StackTrace 2021-05-17 14:36:51 -07:00
compare_output.zig Reduce use of deprecated IO types 2021-01-07 23:48:58 -08:00
compile_errors.zig update langref, compile-error tests, safety tests 2021-05-17 15:25:27 -07:00
gen_h.zig run zig fmt on src/ and test/ 2020-10-31 12:21:49 +02:00
run_translated_c.zig translate-c: fix typedefs with multiple names 2021-05-10 21:59:42 +03:00
runtime_safety.zig update langref, compile-error tests, safety tests 2021-05-17 15:25:27 -07:00
stack_traces.zig update usage of std.testing in behavior and standalone tests 2021-05-08 15:15:30 +03:00
standalone.zig Add standalone test for interdep C archives 2021-04-13 13:32:59 +02:00
tests.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-15 21:44:38 -07:00
translate_c.zig translate-c: translate global (file scope) assembly 2021-05-15 11:53:01 +03:00