From f8ed4852bb9c4a2c21cc894b39bb93acfb0168ad Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Tue, 28 Sep 2021 16:45:55 -0400 Subject: [PATCH 1/3] add some devdocs for `new_opaque_closure` --- doc/src/devdocs/ast.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/doc/src/devdocs/ast.md b/doc/src/devdocs/ast.md index 187c93d7f61e9..6532797122639 100644 --- a/doc/src/devdocs/ast.md +++ b/doc/src/devdocs/ast.md @@ -520,6 +520,36 @@ 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 + + Lower 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) From e4fd2f21e111e1fe43eea6f08c6df209f90968bc Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Tue, 28 Sep 2021 17:34:40 -0400 Subject: [PATCH 2/3] Update doc/src/devdocs/ast.md Co-authored-by: Nick Robinson --- doc/src/devdocs/ast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/devdocs/ast.md b/doc/src/devdocs/ast.md index 6532797122639..1a01207fc00dd 100644 --- a/doc/src/devdocs/ast.md +++ b/doc/src/devdocs/ast.md @@ -538,7 +538,7 @@ These symbols appear in the `head` field of [`Expr`](@ref)s in lowered form. * `args[4]` : ub - Lower bound on the output type. (Defaults to `Any`) + Upper bound on the output type. (Defaults to `Any`) * `args[5]` : method From c6ed7d7efd6a2603fcd417c65aeda4163312e6eb Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Tue, 28 Sep 2021 19:08:21 -0400 Subject: [PATCH 3/3] fix whitespace --- doc/src/devdocs/ast.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/src/devdocs/ast.md b/doc/src/devdocs/ast.md index 1a01207fc00dd..51d39fa20b4e8 100644 --- a/doc/src/devdocs/ast.md +++ b/doc/src/devdocs/ast.md @@ -531,7 +531,7 @@ These symbols appear in the `head` field of [`Expr`](@ref)s in lowered form. * `args[2]` : isva Indicates whether the closure accepts varargs. - + * `args[3]` : lb Lower bound on the output type. (Defaults to `Union{}`) @@ -551,6 +551,7 @@ These symbols appear in the `head` field of [`Expr`](@ref)s in lowered form. !!! compat "Julia 1.7" Opaque closures were added in Julia 1.7 + ### [Method](@id ast-lowered-method) A unique'd container describing the shared metadata for a single method.