From 0e015a449ee96fcce2ce29094660204bf1f944fa Mon Sep 17 00:00:00 2001 From: "Steven S. Lyubomirsky" Date: Fri, 1 Feb 2019 15:25:12 -0800 Subject: [PATCH] checked_type for constructors is not populated --- tests/python/relay/test_adt.py | 2 -- tests/python/relay/test_type_infer.py | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/python/relay/test_adt.py b/tests/python/relay/test_adt.py index fa742f9d65927..7fe48df14bba2 100644 --- a/tests/python/relay/test_adt.py +++ b/tests/python/relay/test_adt.py @@ -87,7 +87,6 @@ def test_nat_value(): def test_nat_constructor(): assert relay.ir_pass.infer_type(z(), mod).checked_type == nat() - assert relay.ir_pass.infer_type(s, mod).checked_type == relay.FuncType([nat()], nat()) assert relay.ir_pass.infer_type(s(z()), mod).checked_type == nat() @@ -105,7 +104,6 @@ def test_add(): def test_list_constructor(): a = relay.TypeVar("a") - assert relay.ir_pass.infer_type(nil, mod).checked_type == relay.FuncType([], l(a), [a]) assert relay.ir_pass.infer_type(cons(z(), nil()), mod).checked_type == l(nat()) diff --git a/tests/python/relay/test_type_infer.py b/tests/python/relay/test_type_infer.py index ccd21f3bfd780..1c20d70dbf9de 100644 --- a/tests/python/relay/test_type_infer.py +++ b/tests/python/relay/test_type_infer.py @@ -192,8 +192,10 @@ def test_constructor_type(): mod = relay.Module() box, constructor = initialize_box_adt(mod) - ct = relay.ir_pass.infer_type(constructor, mod) a = relay.TypeVar('a') + x = relay.Var('x', a) + ct = relay.ir_pass.infer_type( + relay.Function([x], constructor(x), box(a), [a]), mod) expected = relay.FuncType([a], box(a), [a]) assert ct.checked_type == expected