Ejemplo n.º 1
0
        /// <summary>
        /// Gets a new local symbol with the given TypeWithAnnotations as the new type. This
        /// type should be identical to the original except for nullability.
        /// </summary>
        internal LocalSymbol WithAnalyzedType(TypeWithAnnotations analyzedType)
        {
            Debug.Assert(analyzedType.Equals(TypeWithAnnotations, TypeCompareKind.AllNullableIgnoreOptions | TypeCompareKind.IgnoreTupleNames));
            if (analyzedType.Equals(TypeWithAnnotations, TypeCompareKind.ConsiderEverything))
            {
                return(this);
            }

            var cloned = CloneWithoutType();

            cloned.SetTypeWithAnnotations(analyzedType);
            return(cloned);
        }
Ejemplo n.º 2
0
 internal bool MethodEqualityChecks(
     FunctionPointerParameterSymbol other,
     TypeCompareKind compareKind
     ) =>
 FunctionPointerTypeSymbol.RefKindEquals(compareKind, RefKind, other.RefKind) &&
 (
     (compareKind & TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds)
     != 0 ||
     RefCustomModifiers.SequenceEqual(other.RefCustomModifiers)
 ) &&
 TypeWithAnnotations.Equals(other.TypeWithAnnotations, compareKind);