fixed a bug on field typechecking. Now types for local variables and fields are infered. It remains to have inference for return values as well