| 1 | interface Depends { |
| 2 | depends() []Depends |
| 3 | } |
| 4 | |
| 5 | struct Signal[T] { |
| 6 | } |
| 7 | |
| 8 | fn (x Signal[T]) depends() []Depends { |
| 9 | return [] |
| 10 | } |
| 11 | |
| 12 | struct Add[T] { |
| 13 | a Signal[T] |
| 14 | b Signal[T] |
| 15 | } |
| 16 | |
| 17 | fn (a Add[T]) depends() []Depends { |
| 18 | return [a.a, a.b] |
| 19 | } |
| 20 | |
| 21 | fn test_generics_interface_decl() { |
| 22 | assert true |
| 23 | } |
| 24 | |
| 25 | type Action[A, B] = fn (v1 A, v2 B) |
| 26 | |
| 27 | interface PropWithListener[T] { |
| 28 | listen_state(action Action[T, bool]) |
| 29 | } |
| 30 | |
| 31 | fn noop_string_state_action(_ string, _ bool) {} |
| 32 | |
| 33 | fn test_generics_interface_decl_with_fn_type_concrete_param() { |
| 34 | action := Action[string, bool](noop_string_state_action) |
| 35 | action('ready', true) |
| 36 | assert true |
| 37 | } |
| 38 | |