Simulating templates by type-checking
(todo: implement tuple/list expansion, for example, (4, 2) is of type (int, int))