Esempio n. 1
0
        internal void SetType(TypeSymbolWithAnnotations newType)
        {
            TypeSymbol originalType = _type.DefaultType;

            // In the event that we race to set the type of a local, we should
            // always deduce the same type, or deduce that the type is an error.

            Debug.Assert((object)originalType == null ||
                         originalType.IsErrorType() && newType.IsErrorType() ||
                         originalType == newType.TypeSymbol);

            if ((object)originalType == null)
            {
                _type.InterlockedInitialize(newType);
            }
        }
Esempio n. 2
0
        internal void SetType(TypeSymbolWithAnnotations newType)
        {
            Debug.Assert(!(newType.TypeSymbol is null));
            TypeSymbol originalType = _type.DefaultType;

            // In the event that we race to set the type of a local, we should
            // always deduce the same type, or deduce that the type is an error.

            Debug.Assert((object)originalType == null ||
                         originalType.IsErrorType() && newType.IsErrorType() ||
                         TypeSymbol.Equals(originalType, newType.TypeSymbol, TypeCompareKind.ConsiderEverything2));

            if ((object)originalType == null)
            {
                _type.InterlockedInitialize(newType);
            }
        }