ColinEberhardt / assemblyscript-regex

A regex engine for AssemblyScript
MIT License
86 stars 12 forks source link

Fix AS210 error where expressions are never null #45

Closed jonathannorris closed 8 months ago

jonathannorris commented 2 years ago

After updating to the latest version of Assemblyscript 0.20.1, we ran into a couple of small type errors:

INFO AS210: Expression is never 'null'.

       return matchStr != null ? new Match([matchStr!], 0, str) : null;
                                            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(162,44)

INFO AS210: Expression is never 'null'.

           [matchStr!].concat(lastCapturesForGroup(groupMarkers)),
            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(186,12)

INFO AS210: Expression is never 'null'.

       return matchStr != null ? new Match([matchStr!], 0, str) : null;
                                            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(162,44)

INFO AS210: Expression is never 'null'.

           [matchStr!].concat(lastCapturesForGroup(groupMarkers)),
            ~~~~~~~~
 in ~lib/assemblyscript-regex/assembly/regexp.ts(186,12)

Ended up being very minor fixes, let me know if you need any further details.

ColinEberhardt commented 1 year ago

@jonathannorris apologies, I missed this pull request when it was initially opened. Are you still happy with this fix and think it should be merged? If so, I'll review and merge.

jonathannorris commented 8 months ago

Hey @ColinEberhardt yes I believe it should be merged.