You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript 7.0.2 scanner does not advance on bare hash #64490
The scanner repeatedly returns the same non-EOF token without moving from offset 0. A loop that scans until EndOfFile therefore never terminates on a bare # (including when a later comment appears in the same source). Expected: scanning malformed input advances or returns EOF so consumers can terminate. A bare # followed by an identifier scans normally.
The 6.0.3 and Go scanners both move past the # here: 6.0.3 increments inside its diagnostic call, error(Diagnostics.Invalid_character, pos++, charSize(ch)), and Go's scanIdentifier(1, …) consumes it before reporting the same error. The unstable/ast copy reports no diagnostics, and the pos++ went with the call (scanner.ts), so as I read it this is a gap in the port, like #64135. With pos++; after tokenValue = "#";, the reproduction above prints PrivateIdentifier 0 1 and then EndOfFile 1 1.
Activity
RyanCavanaugh commentedon Sep 28, 2026
Just calling
scanin a loop isn't going to give you anything meaningful; this isn't how to use that functiontypescript-automation commentedon Oct 1, 2026
This issue has been marked as "Unactionable" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
YevheniiKotyrlo commentedon Oct 22, 2026
The 6.0.3 and Go scanners both move past the
#here: 6.0.3 increments inside its diagnostic call,error(Diagnostics.Invalid_character, pos++, charSize(ch)), and Go'sscanIdentifier(1, …)consumes it before reporting the same error. Theunstable/astcopy reports no diagnostics, and thepos++went with the call (scanner.ts), so as I read it this is a gap in the port, like #64135. Withpos++;aftertokenValue = "#";, the reproduction above printsPrivateIdentifier 0 1and thenEndOfFile 1 1.