shithub: mc

ref: 1b52ea9d5660f5b21a465f59448941212b2f921e
dir: /test/genericimpl.myr/

View raw version
use std

trait gimpl @a =
	desc	: (x : @a -> byte[:])
;;

impl gimpl int =
	desc = {x
		-> "int"
	}
;;

impl gimpl byte[:] =
	desc = {x
		-> "string"
	}
;;

impl gimpl @a =
	desc = {x
		-> "@a"
	}
;;

impl gimpl @b[:] =
	desc = {x
		-> "@a[:]"
	}
;;

const main = {
	std.put("{} {} {} {}\n", desc(123), desc("foo"), desc('x'), desc([true][:]))
}