コード例 #1
0
        public bool Equals(ISyntaxTypeReference other)
        {
            if (other is null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Type.IsEqualTo(other.Type) &&
                   Context == other.Context &&
                   IsTypeNullable.Equals(other.IsTypeNullable) &&
                   IsElementTypeNullable.Equals(other.IsElementTypeNullable));
        }
コード例 #2
0
        private bool TryGetType <T>(
            ISyntaxTypeReference reference,
            out T type)
            where T : IType
        {
            NamedTypeNode namedType = reference.Type.NamedType();

            if (_typeInitializer.TryGetType(namedType.Name.Value, out IType t) &&
                WrapType(t, reference.Type) is T casted)
            {
                type = casted;
                return(true);
            }

            type = default;
            return(false);
        }