Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Feb 23, 2025
1 parent 0f8dcf5 commit cee8afd
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions vlib/v/tests/concurrency/mut_receiver_gowrapper_test.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module main

@[heap]
interface IGameObject {
mut:
name string
parent ?&IGameObject
children []&IGameObject
advance()
}

@[heap]
struct GameObject implements IGameObject {
mut:
name string
parent ?&IGameObject
children []&IGameObject
}

struct Ship implements IGameObject {
GameObject
speed f32
}

fn (mut gameobject GameObject) advance() {
for mut child in gameobject.children {
go child.advance()
}
}

fn test_main() {
mut ship := &Ship{
name: 'ship'
}
ship.advance()
assert true
}

0 comments on commit cee8afd

Please # to comment.