Skip to content

Module fails to import w/o error, but only when exporting single line function containing $() #301

Open
@sysread

Description

@sysread

The odd circumstances for this to be triggered are:
1. Function is assigned to a variable
2. Function is defined on a single line
3. The function makes use of $(...) to shell out
4. The variable assigned in #1 is returned from the module

This fails without producing any error output:

# scratch.abs
x = f() { $(ls) }
return x

# abs repl
x = require("scratch.abs")
x   # -> null

These do not:

# return one-line, $() function directly
return f() { $(ls) }

# define on multiple lines
x = f() {
    $(ls)
}

return x

# don't use $()
x = f () { return 42 }
return x

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions