Skip to content

Commit af6941a

Browse files
committed
demonstrate that actor methods cannot be imported explicitly
1 parent ca01c14 commit af6941a

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//MOC-FLAG --actor-idl actor-import
2+
//MOC-FLAG --actor-alias self lg264-qjkae
3+
4+
// this imports our own IDL, stored in actor-import
5+
6+
// currently hard-codes the ic-ref self id
7+
// once we have actor aliases we can let run.sh set an alias.
8+
9+
import imported1 "ic:lg264-qjkae";
10+
import { go = imported1_go } "ic:lg264-qjkae";
11+
import { go = imported2_go } "canister:self";
12+
13+
actor a {
14+
public func go() : async (actor {}) = async imported1;
15+
public func go2() : async (actor {}) = async await (imported1_go());
16+
public func go3() : async (actor {}) = async await (imported2_go());
17+
};
18+
//CALL ingress go "DIDL\x00\x00"
19+
//CALL ingress go2 "DIDL\x00\x00"
20+
//CALL ingress go3 "DIDL\x00\x00"
21+
22+
23+
//SKIP run
24+
//SKIP run-ir
25+
//SKIP run-low
26+
27+
// Skip running on drun for now; hard to pass a `--actor-alias` that works for
28+
// both drun and ic-ref-run
29+
//SKIP comp
30+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
explicit-actor-import.mo:10.8-10.29: type error [M0114], object pattern cannot consume actor type
2+
actor {go : shared () -> async actor {}}
3+
explicit-actor-import.mo:11.8-11.29: type error [M0114], object pattern cannot consume actor type
4+
actor {go : shared () -> async actor {}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Return code 1

0 commit comments

Comments
 (0)