fixed a problem in type inference