Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine) Add type arguments for associated constants. #1229

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions engine/lib/import_thir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,18 @@ end) : EXPR = struct
typ = TInt { size = S8; signedness = Unsigned };
})
l))
| NamedConst { def_id = id; impl; _ } -> (
| NamedConst { def_id = id; impl; args; _ } -> (
let kind : Concrete_ident.Kind.t =
match impl with Some _ -> AssociatedItem Value | _ -> Value
in
let f = GlobalVar (def_id kind id) in
match impl with
| Some impl ->
let trait = Some (c_impl_expr e.span impl, []) in
let trait =
Some
( c_impl_expr e.span impl,
List.map ~f:(c_generic_value e.span) args )
in
let f = { e = f; span; typ = TArrow ([], typ) } in
App { f; trait; args = []; generic_args = []; bounds_impls = [] }
| _ -> f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ let constants
(#[FStar.Tactics.Typeclasses.tcresolve ()] i1: t_FooTrait v_T)
(_: Prims.unit)
: usize =
(f_ASSOCIATED_CONSTANT #FStar.Tactics.Typeclasses.solve <: usize) +! v_INHERENT_CONSTANT
(f_ASSOCIATED_CONSTANT #v_T #FStar.Tactics.Typeclasses.solve <: usize) +! v_INHERENT_CONSTANT

let construct_structs (a b: usize) : Prims.unit =
let _:t_StructA = { f_a = a } <: t_StructA in
Expand Down
Loading