Repository navigation
Conversation
added 5 commits
October 3, 2026 04:02
…alid MIR (#2023) `"ab".slice(0, xs[0])` passed the element view `&i64` to with_str_slice_ref's i64 end index; every validator said ok and codegen failed ("wrong argument type actual=ptr expected=i64"). mir_validate_call_unmaterialized_view checks a str intrinsic's index/count arguments and a direct call's scalar parameters against its callee body. Under a stage1 without the Sema fix, `analyze z.w audit:all` now reports: error: invalid MIR before codegen: call argument 2 is a Copy view (&T) where the callee parameter is the owned scalar T: the owned demand was not materialized (#2023) test/internals/mir_call_unmaterialized_view_test.w pins both shapes and their materialized controls.
…64 demands (#2023) Line: SemaCheck.w check_method_call, the `resolved_tk == TypeKind.TY_STR` branch returned builtin_intrinsic_method_return_type's type without looking at any argument. A user fn's i64 parameter goes through note_call_arg_coercion -> record_contextual_copy_adjustment, so MIR reads the pointee (`copy _5.*`); str.slice's did not, so MIR passed the element view (`copy _2`, a &i64) and codegen failed: "wrong argument type actual=ptr expected=i64 fn=apply". It also accepted `"abc".slice("x", 2)` (`check` said ok). Fix: slice's two and byte_at's/repeat's one leading parameters (with_str_slice_ref, with_str_byte_at_ref, with_str_repeat_ref: i64) go through check_builtin_method_call_arg, which records the Copy-view materialization (D22/D27) and refuses a wrong type. Fixtures: behav_2023_str_method_element_view_arg (pre-fix stage1: codegen failed in splice; now prints a / Xb / aXb / 98 / abab); err_2023_str_slice_arg_type (pre-fix: ok; now refused).
…licit main works (#2023) `with analyze z.w audit:all` on a file of top-level statements refused it ("expected declaration" at the first statement, then "analysis compilation failed"), and so did `check --validate-all`, `--validate-ownership`, `--dump-drop-plan`, `--trace-place` and the other Compilation *_file debug entries: they called compile_file, which parses a module, where `check` and `build` call compile_entry_file (§18.5b implicit main). They now compile the root as an entry. deep-debug-tool-tests gains an implicit-main fixture (the #2023 element view into str.slice) under `analyze … audit:all` (violations=0 ok) and `--validate-ownership` (ok); the pre-fix stage1 refused it in both.
The edit is the natural concat again. Under the fixed stage1, --apply over a two-site assignment-mismatch diagnostics file writes output byte-identical to the helper version's. A compiler older than this fix (the pinned seed, the installed v0.15.3.0) still fails it in codegen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2020 (built with seed nightly-20261003-local-1-c884c1c2a17c).
"abc".slice("x", 2)was accepted).&T(T scalar) passed to an owned scalar parameter (str intrinsic index args, direct calls) is invalid MIR, named before codegen.Fixtures: behav_2023_str_method_element_view_arg, err_2023_str_slice_arg_type, internals/mir_call_unmaterialized_view_test, deep-debug-tool-tests implicit-main entries.
src/main build :gate: survey all targets green (367.8s).:drop-audit: 254 cells, 0 regressions. Battery not run.Closes #2023.