1. A method in a processor in a data processing system for executing code using data types, the method comprising: responsive to detecting an operation to store data in a memory location during execution of the code, determining if a first data type is associated with the memory location, wherein the first data type is an expected data type for data stored in the memory location; identifying a second data type of the data to be stored if the first data type is associated with the memory location, wherein the first data type defines an expected data type for the data to be stored in the memory location; responsive to identifying the second data type, comparing the first data type of data with the second data type for the memory location to determine whether the second data type is the expected data type; and storing the data in the memory location, if the second data type is the expected data type, wherein the processor provides an identification of the data types.