Exemplo n.º 1
0
        protected bool Equals(
            TypeSymbol otherType,
            CodeAnalysis.SymbolEqualityComparer equalityComparer
            )
        {
            if (otherType is null)
            {
                return(false);
            }
            else if ((object)otherType == this)
            {
                return(true);
            }

            var compareKind = equalityComparer.CompareKind;

            if (
                NullableAnnotation != otherType.NullableAnnotation &&
                (compareKind & TypeCompareKind.IgnoreNullableModifiersForReferenceTypes) == 0 &&
                (
                    (compareKind & TypeCompareKind.ObliviousNullableModifierMatchesAny) == 0 ||
                    (
                        NullableAnnotation != CodeAnalysis.NullableAnnotation.None &&
                        otherType.NullableAnnotation != CodeAnalysis.NullableAnnotation.None
                    )
                ) &&
                !(UnderlyingTypeSymbol.IsValueType && !UnderlyingTypeSymbol.IsNullableType())
                )
            {
                return(false);
            }

            return(UnderlyingTypeSymbol.Equals(otherType.UnderlyingTypeSymbol, compareKind));
        }
Exemplo n.º 2
0
 ISymbol ITypeSymbol.FindImplementationForInterfaceMember(ISymbol interfaceMember)
 {
     return(interfaceMember is Symbol symbol
       ? UnderlyingTypeSymbol
            .FindImplementationForInterfaceMember(symbol.UnderlyingSymbol)
            .GetPublicSymbol()
       : null);
 }