shithub: mc

ref: f6fadc8f08a0732f22ec6df34822f45e0f3a7f60
dir: /test/neststruct.myr/

View raw version
/* tests that nested structs work. should exit with 3 */
type s1 = struct
	x : s2
;;

type s2 = struct
	a : int
	b : int
;;

const main = {
	var s1 : s1
	var s2 : s2

	s1.x.a = 1
	s1.x.b = 2
	s2 = s1.x

	-> s2.a + s2.b
}