Skip to main content
Version: dev

TypedExpr

std::meta::typed_expr contains methods on the built-in TypedExpr type for resolved and type-checked expressions.

Methods

as_function_definition

as_function_definition
pub comptime fn as_function_definition(self) -> Option<FunctionDefinition> {}

Source code: noir_stdlib/src/meta/typed_expr.nr#L7-L9

If this expression refers to a function definition, returns it. Otherwise returns Option::none().

get_type

get_type
pub comptime fn get_type(self) -> Option<Type> {}

Source code: noir_stdlib/src/meta/typed_expr.nr#L13-L15

Returns the type of the expression, or Option::none() if there were errors when the expression was previously resolved.

location

location
pub comptime fn location(self) -> Location {}

Source code: noir_stdlib/src/meta/typed_expr.nr#L19-L21

Returns the source Location of this expression. This can be passed to std::meta::error or std::meta::warn to attach a diagnostic to the expression.