From 344f9636ce1943695a20e54135d8545ee29fd19b Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 11:33:57 +0100 Subject: [PATCH 1/7] issue-4625 repro --- test/run-drun/issue-4625.mo | 17 +++++++++++++++++ test/run-drun/issue-4625/call.did | 4 ++++ test/run-drun/issue-4625/call.mo | 7 +++++++ test/run-drun/issue-4625/lg264-qjkae.did | 4 ++++ test/run-drun/issue-4625/lib.mo | 3 +++ test/run-drun/ok/issue-4625.tc.ok | 4 ++++ 6 files changed, 39 insertions(+) create mode 100644 test/run-drun/issue-4625.mo create mode 100644 test/run-drun/issue-4625/call.did create mode 100644 test/run-drun/issue-4625/call.mo create mode 100644 test/run-drun/issue-4625/lg264-qjkae.did create mode 100644 test/run-drun/issue-4625/lib.mo create mode 100644 test/run-drun/ok/issue-4625.tc.ok diff --git a/test/run-drun/issue-4625.mo b/test/run-drun/issue-4625.mo new file mode 100644 index 00000000000..b356f1ef674 --- /dev/null +++ b/test/run-drun/issue-4625.mo @@ -0,0 +1,17 @@ +//MOC-FLAG --actor-idl issue-4625 +//MOC-FLAG --actor-alias call lg264-qjkae +import lib "issue-4625/lib"; +import call "canister:call"; + +actor { + type T = actor { + f(x: lib.X): async (); + }; + + let z: T = call; +}; + +//SKIP run +//SKIP run-ir +//SKIP run-low +//SKIP ic-ref \ No newline at end of file diff --git a/test/run-drun/issue-4625/call.did b/test/run-drun/issue-4625/call.did new file mode 100644 index 00000000000..29e4ea0d8e6 --- /dev/null +++ b/test/run-drun/issue-4625/call.did @@ -0,0 +1,4 @@ +type X = null; +service : { + f: (X) -> (); +} diff --git a/test/run-drun/issue-4625/call.mo b/test/run-drun/issue-4625/call.mo new file mode 100644 index 00000000000..eea9b0a8384 --- /dev/null +++ b/test/run-drun/issue-4625/call.mo @@ -0,0 +1,7 @@ +import lib "lib"; + +actor { + public shared func f(x: lib.X): async () { + (); + }; +} \ No newline at end of file diff --git a/test/run-drun/issue-4625/lg264-qjkae.did b/test/run-drun/issue-4625/lg264-qjkae.did new file mode 100644 index 00000000000..29e4ea0d8e6 --- /dev/null +++ b/test/run-drun/issue-4625/lg264-qjkae.did @@ -0,0 +1,4 @@ +type X = null; +service : { + f: (X) -> (); +} diff --git a/test/run-drun/issue-4625/lib.mo b/test/run-drun/issue-4625/lib.mo new file mode 100644 index 00000000000..bdf7350dd04 --- /dev/null +++ b/test/run-drun/issue-4625/lib.mo @@ -0,0 +1,3 @@ +module { + public type X = (); +} \ No newline at end of file diff --git a/test/run-drun/ok/issue-4625.tc.ok b/test/run-drun/ok/issue-4625.tc.ok new file mode 100644 index 00000000000..dd628fd0096 --- /dev/null +++ b/test/run-drun/ok/issue-4625.tc.ok @@ -0,0 +1,4 @@ +issue-4625.mo:11.14-11.18: type error [M0096], expression of type + actor {type X = Null; f : shared X__1 -> async ()} +cannot produce expected type + actor {f : shared X -> async ()} From 7366b08624113adb45680f4663271992268331f0 Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 12:07:31 +0100 Subject: [PATCH 2/7] Update test/run-drun/issue-4625/call.mo Co-authored-by: Gabor Greif --- test/run-drun/issue-4625/call.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run-drun/issue-4625/call.mo b/test/run-drun/issue-4625/call.mo index eea9b0a8384..9a89dc73799 100644 --- a/test/run-drun/issue-4625/call.mo +++ b/test/run-drun/issue-4625/call.mo @@ -1,7 +1,7 @@ import lib "lib"; actor { - public shared func f(x: lib.X): async () { + public shared func f(x : lib.X) : async () { (); }; } \ No newline at end of file From 681d55312d2ffa356c51069e0346738ba5152a2e Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 12:07:36 +0100 Subject: [PATCH 3/7] Update test/run-drun/issue-4625.mo Co-authored-by: Gabor Greif --- test/run-drun/issue-4625.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/run-drun/issue-4625.mo b/test/run-drun/issue-4625.mo index b356f1ef674..63a03a9a671 100644 --- a/test/run-drun/issue-4625.mo +++ b/test/run-drun/issue-4625.mo @@ -5,10 +5,10 @@ import call "canister:call"; actor { type T = actor { - f(x: lib.X): async (); + f(x : lib.X) : async (); }; - let z: T = call; + let z : T = call; }; //SKIP run From 1720e9ab176696b5f6f1e7b0a3eac16a6660174d Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 12:15:53 +0100 Subject: [PATCH 4/7] Apply suggestions from code review --- test/run-drun/issue-4625.mo | 2 +- test/run-drun/issue-4625/call.mo | 2 +- test/run-drun/issue-4625/lib.mo | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/run-drun/issue-4625.mo b/test/run-drun/issue-4625.mo index 63a03a9a671..b1af532cc06 100644 --- a/test/run-drun/issue-4625.mo +++ b/test/run-drun/issue-4625.mo @@ -14,4 +14,4 @@ actor { //SKIP run //SKIP run-ir //SKIP run-low -//SKIP ic-ref \ No newline at end of file +//SKIP ic-ref diff --git a/test/run-drun/issue-4625/call.mo b/test/run-drun/issue-4625/call.mo index 9a89dc73799..201a8ca1397 100644 --- a/test/run-drun/issue-4625/call.mo +++ b/test/run-drun/issue-4625/call.mo @@ -4,4 +4,4 @@ actor { public shared func f(x : lib.X) : async () { (); }; -} \ No newline at end of file +} diff --git a/test/run-drun/issue-4625/lib.mo b/test/run-drun/issue-4625/lib.mo index bdf7350dd04..3b0c621f526 100644 --- a/test/run-drun/issue-4625/lib.mo +++ b/test/run-drun/issue-4625/lib.mo @@ -1,3 +1,3 @@ module { public type X = (); -} \ No newline at end of file +} From ccecd13d5b66cd49b5d3ace32c02ab5d0e4f64e0 Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 12:31:18 +0100 Subject: [PATCH 5/7] moved test to fail --- test/{run-drun => fail}/issue-4625.mo | 0 test/{run-drun => fail}/issue-4625/call.did | 0 test/{run-drun => fail}/issue-4625/call.mo | 0 test/{run-drun => fail}/issue-4625/lg264-qjkae.did | 0 test/{run-drun => fail}/issue-4625/lib.mo | 0 test/{run-drun => fail}/ok/issue-4625.tc.ok | 0 test/fail/ok/issue-4625.tc.ret.ok | 1 + 7 files changed, 1 insertion(+) rename test/{run-drun => fail}/issue-4625.mo (100%) rename test/{run-drun => fail}/issue-4625/call.did (100%) rename test/{run-drun => fail}/issue-4625/call.mo (100%) rename test/{run-drun => fail}/issue-4625/lg264-qjkae.did (100%) rename test/{run-drun => fail}/issue-4625/lib.mo (100%) rename test/{run-drun => fail}/ok/issue-4625.tc.ok (100%) create mode 100644 test/fail/ok/issue-4625.tc.ret.ok diff --git a/test/run-drun/issue-4625.mo b/test/fail/issue-4625.mo similarity index 100% rename from test/run-drun/issue-4625.mo rename to test/fail/issue-4625.mo diff --git a/test/run-drun/issue-4625/call.did b/test/fail/issue-4625/call.did similarity index 100% rename from test/run-drun/issue-4625/call.did rename to test/fail/issue-4625/call.did diff --git a/test/run-drun/issue-4625/call.mo b/test/fail/issue-4625/call.mo similarity index 100% rename from test/run-drun/issue-4625/call.mo rename to test/fail/issue-4625/call.mo diff --git a/test/run-drun/issue-4625/lg264-qjkae.did b/test/fail/issue-4625/lg264-qjkae.did similarity index 100% rename from test/run-drun/issue-4625/lg264-qjkae.did rename to test/fail/issue-4625/lg264-qjkae.did diff --git a/test/run-drun/issue-4625/lib.mo b/test/fail/issue-4625/lib.mo similarity index 100% rename from test/run-drun/issue-4625/lib.mo rename to test/fail/issue-4625/lib.mo diff --git a/test/run-drun/ok/issue-4625.tc.ok b/test/fail/ok/issue-4625.tc.ok similarity index 100% rename from test/run-drun/ok/issue-4625.tc.ok rename to test/fail/ok/issue-4625.tc.ok diff --git a/test/fail/ok/issue-4625.tc.ret.ok b/test/fail/ok/issue-4625.tc.ret.ok new file mode 100644 index 00000000000..69becfa16f9 --- /dev/null +++ b/test/fail/ok/issue-4625.tc.ret.ok @@ -0,0 +1 @@ +Return code 1 From 89e2d17fb2fe12ea0e43d19e2748e51d7481bd98 Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 12:47:44 +0100 Subject: [PATCH 6/7] update test output --- test/fail/ok/issue-4625.tc.ok | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fail/ok/issue-4625.tc.ok b/test/fail/ok/issue-4625.tc.ok index dd628fd0096..d243cf2687a 100644 --- a/test/fail/ok/issue-4625.tc.ok +++ b/test/fail/ok/issue-4625.tc.ok @@ -1,4 +1,4 @@ -issue-4625.mo:11.14-11.18: type error [M0096], expression of type +issue-4625.mo:11.15-11.19: type error [M0096], expression of type actor {type X = Null; f : shared X__1 -> async ()} cannot produce expected type actor {f : shared X -> async ()} From 79710b146765ab1a85d647352b66593a10836fdf Mon Sep 17 00:00:00 2001 From: Claudio Russo Date: Thu, 15 Aug 2024 13:00:56 +0100 Subject: [PATCH 7/7] remove skips --- test/fail/issue-4625.mo | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/fail/issue-4625.mo b/test/fail/issue-4625.mo index b1af532cc06..5bbc4303971 100644 --- a/test/fail/issue-4625.mo +++ b/test/fail/issue-4625.mo @@ -10,8 +10,3 @@ actor { let z : T = call; }; - -//SKIP run -//SKIP run-ir -//SKIP run-low -//SKIP ic-ref