Join type inference