add tests for type inference