struct EventListener {
mut:
	x int
}

type PEventListener = &EventListener

struct StructOfFixedArraysOfListeners {
mut:
	elisteners    [3]EventListener
	apelisteners  [3]PEventListener
	pelisteners   [3]&EventListener
	ppelisteners  [3]&&EventListener
	pppelisteners [3]&&&EventListener
}

fn main() {
	mut x := StructOfFixedArraysOfListeners{}
	x.elisteners[0].x = 123
	x.apelisteners[0] = &x.elisteners[0]
	x.pelisteners[0] = &x.elisteners[0]
	//
	x.ppelisteners[0] = &x.pelisteners[0]
	x.pppelisteners[0] = &x.ppelisteners[0]
	eprintln('------------------------------------')
	eprintln(x.elisteners)
	eprintln('- 1 level of indirection -')
	eprintln(x.apelisteners)
	eprintln(x.pelisteners)
	eprintln('- 2 level of indirection -')
	eprintln(x.ppelisteners)
	eprintln('- 3 level of indirection -')
	eprintln(x.pppelisteners)
	eprintln('-----------------------------------------------------')
	eprintln('- all:')
	eprintln(x)
	eprintln('-----------------------------------------------------')
	fa := [2]EventListener{}
	eprintln(fa)
	pfa := [2]&EventListener{}
	eprintln(pfa)
	ppfa := [2]&&EventListener{}
	eprintln(ppfa)
	eprintln('-----------------------------------------------------')
	dynamic_pfa := [&x.elisteners[0], &x.elisteners[1]]
	eprintln(dynamic_pfa)
}
