Skip to content

^10.0.0-alpha.1 template literals output "regression" #5521

Closed
@DZakh

Description

@DZakh

The compiler started adding empty strings around values in template literals. Technically doesn't break anything, but adds a redundant operation.

Example:

Js.log(`${1->Js.Int.toString}${2->Js.Int.toString}`)

Output:

console.log("" + (1).toString() + "" + (2).toString() + "");

Before:

console.log((1).toString() + (2).toString());

Context: DZakh/sury#1 (comment), #5514 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions