From f7b5c063152b1f6c1a572d200a59af8d420a2f1a Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Fri, 27 Sep 2024 17:29:27 +0100 Subject: [PATCH] invert condition and update output --- src/mo_frontend/typing.ml | 2 +- src/pipeline/pipeline.ml | 2 +- test/run-drun/ok/bad-actor.comp-ref.ok | 4 ++-- test/run-drun/ok/bad-actor.comp.ok | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mo_frontend/typing.ml b/src/mo_frontend/typing.ml index e31e4952bd1..13eaeef228e 100644 --- a/src/mo_frontend/typing.ml +++ b/src/mo_frontend/typing.ml @@ -2975,7 +2975,7 @@ let is_actor_dec d = | _ -> false let check_actors ?(viper_mode=false) ?(check_actors=false) scope progs : unit Diag.result = - if check_actors then Diag.return () else + if not check_actors then Diag.return () else Diag.with_message_store (fun msgs -> recover_opt (fun progs -> diff --git a/src/pipeline/pipeline.ml b/src/pipeline/pipeline.ml index 07e197cb29c..630abc386f8 100644 --- a/src/pipeline/pipeline.ml +++ b/src/pipeline/pipeline.ml @@ -421,7 +421,7 @@ let chase_imports parsefn senv0 imports : (Syntax.lib list * Scope.scope) Diag.r in Diag.map (fun () -> (List.rev !libs, !senv)) (go_set None imports) -let load_progs ?(viper_mode=false) ?(check_actors = false) parsefn files senv : load_result = +let load_progs ?(viper_mode=false) ?(check_actors=false) parsefn files senv : load_result = let open Diag.Syntax in let* parsed = Diag.traverse (parsefn Source.no_region) files in let* rs = resolve_progs parsed in diff --git a/test/run-drun/ok/bad-actor.comp-ref.ok b/test/run-drun/ok/bad-actor.comp-ref.ok index d25ca49a72e..6857d9d6994 100644 --- a/test/run-drun/ok/bad-actor.comp-ref.ok +++ b/test/run-drun/ok/bad-actor.comp-ref.ok @@ -1,2 +1,2 @@ -bad-actor.mo:2.1-4.2: type error [M0038], misplaced await -bad-actor.mo:2.1-4.2: type error [M0037], misplaced async expression; try enclosing in an async function +bad-actor.mo:2.1-4.2: type error [M0141], an actor or actor class must be the only non-imported declaration in a program + (This is a limitation of the current version and flag -ref-system-api.) diff --git a/test/run-drun/ok/bad-actor.comp.ok b/test/run-drun/ok/bad-actor.comp.ok index d25ca49a72e..89d92c9584c 100644 --- a/test/run-drun/ok/bad-actor.comp.ok +++ b/test/run-drun/ok/bad-actor.comp.ok @@ -1,2 +1,2 @@ -bad-actor.mo:2.1-4.2: type error [M0038], misplaced await -bad-actor.mo:2.1-4.2: type error [M0037], misplaced async expression; try enclosing in an async function +bad-actor.mo:2.1-4.2: type error [M0141], an actor or actor class must be the only non-imported declaration in a program + (This is a limitation of the current version.)