---
source: compiler-core/src/erlang/tests.rs
expression: "pub fn x(y) {\n  let assert Ok(_) = y\n  1\n}"
---
----- SOURCE CODE
pub fn x(y) {
  let assert Ok(_) = y
  1
}

----- COMPILED ERLANG
-module(my@mod).
-compile([no_auto_import, nowarn_ignored, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-export([x/1]).

-file("project/test/my/mod.gleam", 1).
-spec x({ok, any()} | {error, any()}) -> integer().
x(Y) ->
    case Y of
        {ok, _} ->
            1;

        _value ->
            erlang:error(#{
                gleam_error => let_assert,
                message => ~"Pattern match failed, no pattern matched the value.",
                file => ~"project/test/my/mod.gleam",
                module => ~"my/mod",
                function => ~"x",
                line => 2,
                value => _value,
                start => 16,
                'end' => 36,
                pattern_start => 27,
                pattern_end => 32
            })
    end.
