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
Foreign effect ID scanning uses the wrong line-continuation rules #1604
I hit this on main (234cb9b) while returning a constructor from a foreign effect. The source scanner uses C backslash continuation rules for JS comments, but misses C continuations when the file uses CRLF.
For an effect returning Maybe<&1, U32>, this valid JS fails at runtime with ReferenceError: CID is not defined:
functionprobe(){// A path ending in backslash: C:\return{$: CID(Some),value: 42};}io_eff(CID(probe),probe);
With CRLF line endings, this valid C comment instead makes compilation fail with CID(NotASymbol) names no constructor or def:
// A quoted macro example: \CID(NotASymbol)
The C preprocessor keeps the second line in the comment. JS does not: its comment ends at the first newline even when preceded by a backslash. The scanner currently gets both cases backwards. C also allows a CID token itself to be split with backslash-newline; that remains unreplaced and clang rejects it.
I have a small fix that splices C lines before scanning and leaves JS lines alone, plus a regression exercising real constructor returns on both backends. AI-assisted investigation and patch.
Activity