| ... | @@ -1872,15 +1872,22 @@ fn analyzeNavVal( | ... | @@ -1872,15 +1872,22 @@ fn analyzeNavVal( |
| 1872 | // that case and invalidate the dependee right now. | 1872 | // that case and invalidate the dependee right now. |
| 1873 | if (zcu.clearOutdatedState(.wrap(.{ .nav_ty = nav_id }))) { | 1873 | if (zcu.clearOutdatedState(.wrap(.{ .nav_ty = nav_id }))) { |
| 1874 | assert(zir_decl.type_body == null); // otherwise we already resolved it with `Sema.ensureNavResolved` | 1874 | assert(zir_decl.type_body == null); // otherwise we already resolved it with `Sema.ensureNavResolved` |
| 1875 | zcu.resetUnit(.wrap(.{ .nav_ty = nav_id })); | 1875 | const type_unit: AnalUnit = .wrap(.{ .nav_ty = nav_id }); |
| 1876 | try pt.addDependency(.wrap(.{ .nav_ty = nav_id }), .{ .nav_val = nav_id }); // inferred type depends on the value (that's us!) | 1876 | const prev_type_failed = zcu.failed_analysis.contains(type_unit) or |
| | 1877 | zcu.transitive_failed_analysis.contains(type_unit); |
| | 1878 | zcu.resetUnit(type_unit); |
| | 1879 | try pt.addDependency(type_unit, .{ .nav_val = nav_id }); // inferred type depends on the value (that's us!) |
| 1877 | if (comp.debugIncremental()) { | 1880 | if (comp.debugIncremental()) { |
| 1878 | const info = try zcu.incremental_debug_state.getUnitInfo(gpa, .wrap(.{ .nav_ty = nav_id })); | 1881 | const info = try zcu.incremental_debug_state.getUnitInfo(gpa, type_unit); |
| 1879 | info.last_update_gen = zcu.generation; | 1882 | info.last_update_gen = zcu.generation; |
| 1880 | info.deps.clearRetainingCapacity(); | 1883 | info.deps.clearRetainingCapacity(); |
| 1881 | } | 1884 | } |
| 1882 | const type_changed: bool = if (old_nav.resolved) |r| r.type != nav_ty.toIntern() else true; | 1885 | const type_outdated: bool = type_outdated: { |
| 1883 | if (type_changed) { | 1886 | if (prev_type_failed) break :type_outdated true; |
| | 1887 | const r = old_nav.resolved orelse break :type_outdated true; |
| | 1888 | break :type_outdated r.type != nav_ty.toIntern(); |
| | 1889 | }; |
| | 1890 | if (type_outdated) { |
| 1884 | try zcu.markDependeeOutdated(.marked_po, .{ .nav_ty = nav_id }); | 1891 | try zcu.markDependeeOutdated(.marked_po, .{ .nav_ty = nav_id }); |
| 1885 | } else { | 1892 | } else { |
| 1886 | try zcu.markPoDependeeUpToDate(.{ .nav_ty = nav_id }); | 1893 | try zcu.markPoDependeeUpToDate(.{ .nav_ty = nav_id }); |