shithub: mc

ref: a3b2adffd9eeb3d15e54cfcba7b1f1097ade002d
dir: /test/genericrec.myr/

View raw version
use std
/* test that generic types can be recursive, as long as they're not self
 * including. This just needs to compile and exit with 0. */
type list(@t) = struct
	val	: @t
	next	: list(@t)#
;;

const main = {
	var v : list(int)
	var n

	v.val = 123
	v.next = std.alloc()
	v.next.val = 234
}