mila-iqia/myia

Specialize error

abergeron opened this issue · 0 comments

This function will fail in specialize:

@specialize((True, int1, int2))
def test_call_hof(c, x, y):
    def f1(x, y):
	return x + y

    def f2(x, y):
        return y + x

    def choose(c):
	if c:
            return f1
        else:
            return f2

    return choose(c)(x, 2) + choose(not c)(2, y)