Skip to content

Bug: Multi-line implicit string concatenation not joined #36

@swernerx

Description

@swernerx

Description

Python allows implicit string concatenation across multiple lines (without + operator). These are not being joined in the TypeScript output.

Python Input

msg = ("This is a very long error message that "
       "spans multiple lines for readability")

regex = (r'(?P<order1>[<>|=]?)'
         r'(?P<repeats> *[(]?[ ,0-9]*[)]? *)'
         r'(?P<dtype>[A-Za-z0-9.?]*)')

raise ValueError("Invalid input: expected array-like "
                 "but got something else")

Current Output (v1.3.3)

let msg = ("This is a very long error message that "
       "spans multiple lines for readability")  // ❌ INVALID!

let regex = (r'(?P<order1>[<>|=]?)'
         r'(?P<repeats> *[(]?[ ,0-9]*[)]? *)'
         r'(?P<dtype>[A-Za-z0-9.?]*)')  // ❌ INVALID!

throw new Error("Invalid input: expected array-like "
                 "but got something else")  // ❌ INVALID!

Expected Output

const msg = "This is a very long error message that " +
            "spans multiple lines for readability"

const regex = '(?P<order1>[<>|=]?)' +
              '(?P<repeats> *[(]?[ ,0-9]*[)]? *)' +
              '(?P<dtype>[A-Za-z0-9.?]*)'

throw new Error("Invalid input: expected array-like " +
                "but got something else")

Note

This is different from multi-line f-strings (#34) - this covers regular strings and raw strings.

Affected Files

Found ~100 occurrences in NumPy migration.

Priority

🔴 Critical - Causes ~300 errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions