Skip to content

Commit

Permalink
base-env: try to use syntax.anchor if set for prim func type arg binding
Browse files Browse the repository at this point in the history
  • Loading branch information
LunNova committed Jan 15, 2024
1 parent 98db5c7 commit d189b41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base-env.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ local prim_func_type_impl_reducer = metalang.reducer(function(syntax, env)
ok, continue = true, true
local shadowed, env = env:enter_block()

env = env:bind_local(terms.binding.annotated_lambda("#arg", build_type_term(args), pft_anchor))
-- syntax.anchor can be nil so we fall back to the anchor for the start of this prim func type if needed
env = env:bind_local(terms.binding.annotated_lambda("#arg", build_type_term(args), syntax.anchor or pft_anchor))
local ok, arg = env:get("#arg")
env = env:bind_local(terms.binding.tuple_elim(names, arg))
names = gen.declare_array(gen.builtin_string)()
Expand Down

0 comments on commit d189b41

Please sign in to comment.