Skip to content

Js.Re.matches -> RegExp.Result.matches - Unexpected bug caused by migration to v12 #8029

Closed as not planned

Description

@DZakh

https://rescript-lang.org/try?version=v12.0.0-rc.3&module=esmodule&code=DYUwLgBAhhC8EFIBOUDuAKABgbQLqYEoBaAPgCkBnAOgCUQqBbKMAYwAsQKAoL0SAIziIUGHPmIk6AcwCiADwAOtTgFdgYRs3acgA

The automated migration results in a different output, which was very difficult to trace in my case. I spent around 4 hours today (mostly because the issue wasn't reproducing locally)

Activity

  1. zth commented on Nov 21, 2025

    @zth
    Member

    Could you have a look at the migration and see what the solution might be? What is it doing wrong?

  2. DZakh commented on Nov 21, 2025

    @DZakh
    MemberAuthor

    I think the migration logic is correct; it's just different logic now, which fixes the previous incorrect behaviour.

  3. zth commented on Nov 21, 2025

    @zth
    Member

    I don't understand. What's the problem here if the migration is not wrong?

  4. DZakh commented on Nov 23, 2025

    @DZakh
    MemberAuthor

    Look at the generated code. It produces different output, which leads to different runtime behaviour.

  5. zth commented on Nov 24, 2025

    @zth
    Member

    Then I would say that the migration isn't correct, or even can't be done, if the APIs are not equivalent. What do you think?

  6. cknitt commented on Oct 19, 2026

    @cknitt
    Member

    This is obsolete on master: the Js modules, including Js.Re, were removed in #8531, so the Js.Re.matches migration no longer exists there. The semantic difference of the v12 migration remains a known pitfall for 12.x users. Closing.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions