shithub: mc

ref: de496a920339b8285ca2e9225b1abff7af54698a
dir: /test/compoundimpl.myr/

View raw version
use std

trait frobable @a =
	frob	: (val : @a -> void)
;;

impl frobable int# =
	frob = {val
		std.put("intptr,")
	}
;;

impl frobable char# =
	frob = {val
		std.put("charptr\n")
	}
;;

generic foo = {x : @a::frobable
	frob(x)
}

const main = {
	var a = (123 : int)
	var b = 'c'
	foo(&a)
	foo(&b)
}