Skip to content

[BUG] Recursive inlining doesn't expand correctly #99

@viluon

Description

@viluon

Describe the bug

Recursive inlining kicks in just fine for macros, but calling $$inline from a regular function and then inlining that function demonstrates that macros are not expanded in the correct order.

Code to reproduce

function foo(msg: string) {
    return console.log(msg)
}

function oof(msg: string) {
    return $$inline!(foo, [msg]);
}

$$inline!(oof, ["hi"]);

Expands to

function foo(msg) {
    return console.log(msg);
}
function oof(msg) {
    return console.log(msg);
}
$$inline(foo, ["hi"]);

(I tried to produce a playground link but couldn't1.)

Expected behavior

No $$inline in the output, oof is properly inlined to produce console.log("hi").

Footnotes

  1. The "Copy link" button isn't working for me and it seems that the URL format employs a compression scheme (going by the decoded base64 output for existing playground links) that I couldn't reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions