Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing The Implementation of Traits.


On Sun, 20 Aug 2017 20:32:00 -0700, Ori Bernstein <ori@xxxxxxxxxxxxxx> wrote:
> 
> If you've got some trait heavy code, throw it at this and see if you
> can break it!

So, there's one known bug, but I merged it anyways. The trait checking code is
a little lax when checking whether a parameters to a generic impl is
sufficiently constrained by its traits.

For example:

	impl foo @a::numeric =
		fooify = {a; -> a + 1}
	;;

	fooify("not a number")

This is relatively easy to fix, mainly needing some additional checking in
parse/type.c:863. Still, it seems to fix enough of the issues that people
were running into to merge it now.

-- 
    Ori Bernstein

References:
Fixing The Implementation of Traits.Ori Bernstein <ori@xxxxxxxxxxxxxx>