Skip to content

own: a value pushed where not null; literal unions as views; moves on every path; constant literal globals (TSLANG 67-70); string literal union type check - #855

Merged
ASDAlexander77 merged 9 commits into
mainfrom
fix-own-items-67
Nov 14, 2026
Merged

ASDAlexander77 merged 9 commits into
mainfrom
fix-own-items-67

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Fixes from the -mm=own sweep of native_ts_graphics (TSLANG 67-70, written up in TSLANG_ISSUES.md), plus a type check for unions of string literals.

-mm=own

  • 67: a value pushed only where it is not null (if (x) arr.push(x); use(x)) is read back from the array on the pushed path and is null on the other.
  • 68: a union of string literals, like a string, is read as a copyable view.
  • 69: a value moved on every path, by a different move on each, is no longer refused as moved on some paths only.
  • 70: a constant global of a string literal's type, given to a call that keeps it, is an immortal literal.

Type checking

  • A union of string literals ("no" | "yes") takes only its literals. Another literal, or a string, given to it is an error (TS2322 for assignments and declarations, TS2345 for arguments).
  • A parameter property typed by its default (private flags = "") has the default's widened type (string), as in TS. DefaultLib's RegExp depends on this.

Tests

  • Every model: 00tslang_issue_67, 00tslang_issue_69.
  • Error tests:
    • assign_string_literal_union_error
    • assign_string_to_literal_union_error
    • argument_string_literal_union_error
    • own_err_pushed_or_null_popped
    • own_err_moved_on_two_of_three_paths
  • The literal-union error tests are by design and excluded from the ownership verifier.

Validation

  • ctest: 7331 of 7331 passed.
  • DefaultLib tests.ps1: all four models passed. Results are in a comment.
  • ntg sweep: 639 errors before these changes, 635 after.

🤖 Generated with Claude Code

ASDAlexander77 and others added 9 commits November 14, 2026 18:17
…string literals read as a string (TSLANG 67, 68)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or a string given to it is an error (TS2322, TS2345)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on error tests are errors by design for the verifier

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… type: `private flags = ""` is a string

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 69)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at keeps it (TSLANG 70)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77

Copy link
Copy Markdown
Owner Author

DefaultLib tests.ps1 (Windows, release + debug, compile + jit) built with c557668:

== gc
Finished release, compile : 224/225 passed, 1 skipped
Finished release, jit : 224/225 passed, 1 skipped
Finished debug, compile : 224/225 passed, 1 skipped
Finished debug, jit : 224/225 passed, 1 skipped
Done. All tests passed.
== none
Finished release, compile : 221/225 passed, 4 skipped
Finished release, jit : 221/225 passed, 4 skipped
Finished debug, compile : 221/225 passed, 4 skipped
Finished debug, jit : 221/225 passed, 4 skipped
Done. All tests passed.
== rc
Finished release, compile : 221/225 passed, 4 skipped
Finished release, jit : 221/225 passed, 4 skipped
Finished debug, compile : 221/225 passed, 4 skipped
Finished debug, jit : 221/225 passed, 4 skipped
Done. All tests passed.
== own
Finished release, compile : 219/225 passed, 6 skipped
Finished release, jit : 219/225 passed, 6 skipped
Finished debug, compile : 219/225 passed, 6 skipped
Finished debug, jit : 219/225 passed, 6 skipped
Done. All tests passed.

ctest: 100% tests passed, 0 tests failed out of 7331

@ASDAlexander77
ASDAlexander77 merged commit 098535a into main Nov 14, 2026
8 checks passed
@ASDAlexander77
ASDAlexander77 deleted the fix-own-items-67 branch November 14, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant