Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

comptimeExpr

Private Function
std.zig.AstGen.comptimeExpr
fn comptimeExpr(
    gz: *GenZir,
    scope: *Scope,
    ri: ResultInfo,
    node: Ast.Node.Index,
    reason: std.zig.SimpleComptimeReason,
) InnerError!Zir.Inst.Ref

This explicitly calls expr in a comptime scope by wrapping it in a block_comptime if necessary. It should be used whenever we need to force compile-time evaluation of something, such as a type. The function corresponding to comptime expression syntax is comptimeExprAst.

Params

Errors

OutOfMemory
AnalysisFail

File

zig/AstGen.zig:1983
1983
1984
1985
1986
1987
1988
1989
1990
1991
fn comptimeExpr(
    gz: *GenZir,
    scope: *Scope,
    ri: ResultInfo,
    node: Ast.Node.Index,
    reason: std.zig.SimpleComptimeReason,
) InnerError!Zir.Inst.Ref {
    return comptimeExpr2(gz, scope, ri, node, node, reason);
}