---
source: compiler-core/src/erlang/tests.rs
expression: "pub type State{ Start(Int) End(Int) }\n            pub fn build(constructor : fn(Int) -> a) -> a { constructor(1) }\n            pub fn main() { build(End) }"
---
----- SOURCE CODE
pub type State{ Start(Int) End(Int) }
            pub fn build(constructor : fn(Int) -> a) -> a { constructor(1) }
            pub fn main() { build(End) }

----- COMPILED ERLANG
-module(my@mod).
-compile([no_auto_import, nowarn_ignored, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-export([build/1, main/0]).
-export_type([state/0]).

-type state() :: {start, integer()} | {'end', integer()}.

-file("project/test/my/mod.gleam", 2).
-spec build(fun((integer()) -> I)) -> I.
build(Constructor) ->
    Constructor(1).

-file("project/test/my/mod.gleam", 3).
-spec main() -> state().
main() ->
    build(fun(_value) ->
        {'end', _value}
    end).
