Skip to content
Merged
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
12 changes: 8 additions & 4 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ let check_file face json path =
(match Affinescript.Resolve.resolve_program_with_loader prog loader with
| Error (e, span) ->
add (Affinescript.Json_output.of_resolve_error e span)
| Ok (resolve_ctx, _type_ctx) ->
| Ok (resolve_ctx, type_ctx) ->
(* Phase B+C: capture symbol table and use-site references. *)
symbols_table := Some resolve_ctx.symbols;
resolve_refs := List.rev resolve_ctx.references;
(match Affinescript.Typecheck.check_program resolve_ctx.symbols prog with
(match Affinescript.Typecheck.check_program
~import_types:type_ctx.Affinescript.Typecheck.name_types
resolve_ctx.symbols prog with
| Error e ->
add (Affinescript.Json_output.of_type_error e)
| Ok _ctx ->
Expand Down Expand Up @@ -229,8 +231,10 @@ let check_file face json path =
Format.eprintf "@[<v>Resolution error: %s@]@."
(Affinescript.Face.format_resolve_error face e);
`Error (false, "Resolution error")
| Ok (resolve_ctx, _type_ctx) ->
(match Affinescript.Typecheck.check_program resolve_ctx.symbols prog with
| Ok (resolve_ctx, type_ctx) ->
(match Affinescript.Typecheck.check_program
~import_types:type_ctx.Affinescript.Typecheck.name_types
resolve_ctx.symbols prog with
| Error e ->
Format.eprintf "@[<v>%s@]@."
(Affinescript.Face.format_type_error face e);
Expand Down
Loading