change getType to inferType