Repository navigation
Prove the values the non-null assertions asserted, where a test or loop form can - #115
Merged
Merged
Conversation
- The console reporter draws its progress frame from a text and a dot count rather than reading an array by index. - The two conformance tests check that their case's record exists with Assert.isDefined. - The for-in/of check destructures its first two declarations once, where it already returned for an empty list. - The rest-initializer check tests the binding element's equals node, which the parser sets exactly when it sets the initializer. Part of #96. Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV1 (developer) Agent-Model: Anthropic Opus 5.5, Medium
rostislavrotaru
marked this pull request as ready for review
November 15, 2026 01:47
rostislavrotaru
commented
Nov 15, 2026
rostislavrotaru
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed: #115 at e3dd4f7
Verdict: Approve
Findings: 0 Should fix, 0 Low, as line comments
Why it's right: seven non-null assertions are proved by their types with no hidden assertion or untested branch, no exported API changes, and the twelve sites left for the shared helper are named; #96 stays open for them.
Agent: LEAD (lead)
Agent-Model: Anthropic Opus 5.5, High
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.
Issue: #96
Removes the non-null assertions that a loop form, destructuring or
Assert.isDefinedin a test can prove. #96 stays open for the sites below, which wait on a shared helper.Changed
noldova.context.testing/src/resources.ts,services/reporting/test-console-reporter.ts: the progress line is built from its text and a count of dots, so no array read needs!. The output is unchanged.parsers.typescript/tests/conformance/conformance-cases.test.ts,parsers.regex/tests/conformance/conformance-cases.test.ts:Assert.isDefinedon the case's record.typescript-for-in-or-of-statement.node.extensions.ts: destructures the first two declarations instead of readingchildren[0]!.typescript-binding-element.node.extensions.ts: the rest-initializer check testsequalsNode, which every construction sets together withinitializerNode, so its span needs no!.parsers.typescript/tests/fixtures/typescript-diagnostics.fixture.ts:Assert.isDefinedon a related location, like the fixture's other location reads.parsers.typescript/src/api/index.d.ts: theTypeScriptTypeOperatorNodeexample compares against the operand it built, instead oftype.typeNode!.Left for the helper (12 sites)
Production code has no
Assert.isDefined, and an inline guard on these would be unreachable, which fails the 100% coverage gate.collections/src/services/binary-search.service.ts:16,parsers.typescript/src/models/typescript-region-set.ts:32and:38,testing/src/services/coverage/file-coverage-analyzer.ts:176.codePointAton an offset already in range:parsers/src/services/source.reader.ts:59,parsers.regex/.../regex-named-capturing-group.parser.ts:45.typescript-expression-with-type-arguments.node.extensions.ts:37(typeArgumentListNode: only the expression parsers reach it, and they always set a list).typescript-block.node.extensions.ts:20(openBraceNode): a missing block is never a statement or a node's first child, and no test I found reaches its first token.Diagnostic.location(4 sites, 7 reads):parsers.typescript/src/services/typescript.parser.ts:66,:77,:108(four reads in one comparison) andservices/parsers/source.parser.ts:78. The syntax diagnostics come from the exportedDiagnosticCollectorasDiagnostic[], so an internal located type would need the same proof or an API change.Agent: DEV1 (developer)
Agent-Model: Anthropic Opus 5.5, Medium