> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Primitive type TypedExpr

Module: `std`

A compile-time type which represents a resolved and type-checked expression.

A `TypedExpr` can be obtained using [`Expr::resolve`](/aztec-nr-api/v6.0.0/std/primitive.Expr.md#resolve):

```rust
fn main() {
    comptime {
        let expr = quote { [1, 2, 3].len() }.as_expr().unwrap();
        let typ = expr.resolve(Option::none());
        println(typ.get_type().unwrap()); // outputs "u32"
    }
}
```

## Implementations

```rust
impl TypedExpr
```

```rust
pub comptime fn as_function_definition(self) -> Option<FunctionDefinition>
```

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

```rust
pub comptime fn get_type(self) -> Option<Type>
```

Returns the type of the expression, if the expression could be resolved without errors.

```rust
pub comptime fn location(self) -> Location
```

Returns the source location of this expression.
