Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some devdocs for new_opaque_closure #42418

Merged
merged 3 commits into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions doc/src/devdocs/ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,37 @@ These symbols appear in the `head` field of [`Expr`](@ref)s in lowered form.
The additional objects that may need to be gc-rooted for the duration of the call.
See [Working with LLVM](@ref Working-with-LLVM) for where these are derived from and how they get handled.

* `new_opaque_closure`

Constructs a new opaque closure. The fields are:

* `args[1]` : signature

The function signature of the opaque closure. Opaque closures don't participate in dispatch, but the input types can be restricted.

* `args[2]` : isva

Indicates whether the closure accepts varargs.

* `args[3]` : lb

Lower bound on the output type. (Defaults to `Union{}`)

* `args[4]` : ub

Upper bound on the output type. (Defaults to `Any`)

* `args[5]` : method

The actual method as an `opaque_closure_method` expression.

* `args[6:end]` : captures

The values captured by the opaque closure.

!!! compat "Julia 1.7"
Opaque closures were added in Julia 1.7


### [Method](@id ast-lowered-method)

Expand Down