Skip to content

naming an fn parameter __unused breaks codegen #3187

Description

@matthewleon

Admittedly a very, very tiny edge case but still, it feels morally wrong:

abuseUnused :: forall a. a -> a
abuseUnused __unused = __unused
var abuseUnused = function () {
    return __unused;
};

The culprit here is the removeUnusedArg optimization, which bases its functionality off the name of the argument.

Potential easy solution: change the constant to an illegal name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions