---
source: compiler-core/src/erlang/tests.rs
expression: "\npub fn factory(f, i) {\n  f(i)\n}\n\npub type Box {\n  Box(i: Int)\n}\n\npub fn main() {\n  factory(Box, 0)\n}\n"
---
----- SOURCE CODE

pub fn factory(f, i) {
  f(i)
}

pub type Box {
  Box(i: Int)
}

pub fn main() {
  factory(Box, 0)
}


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

-type box() :: {box, integer()}.

-file("project/test/my/mod.gleam", 2).
-spec factory(fun((J) -> N), J) -> N.
factory(F, I) ->
    F(I).

-file("project/test/my/mod.gleam", 10).
-spec main() -> box().
main() ->
    factory(fun(_value) ->
        {box, _value}
    end, 0).
