aboutsummaryrefslogtreecommitdiff
path: root/tests/struct_priv_trait_cont/struct_priv_trait_cont.ek
blob: 7fb7e122aa450dd4e62db62a2a26108b87d14f7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import "struct.ek"

/* we implement trait here, but there's another private implementation in
 * `struct.ek`. Intuitively, I would expect that `p` would end up calling
 * this implementation, since without this continuation the code wouldn't
 * compile, but the current instanciation/unification system doesn't handle this
 * correctly, and the `do_something()` in `struct.ek` is the one that gets
 * called (since that's the trait implementation visible to that section of the
 * continuation chain).
 *
 * On a related note, for whatever reason `do_something()` doesn't get written
 * by the codegen. Should maybe try and do something about that as well.
 */
continue implementer {
	trait!;
	do_something(=> i27)
	{
		return 1;
	}
}

main()
{
	mut p = struct![implementer]{
		.a = implementer!{}
	};
	p.call_something();

	some_func();
}