示例#1
0
        public override BoundNode VisitRefTypeOperator(BoundRefTypeOperator node)
        {
            if (_inExpressionLambda)
            {
                Error(ErrorCode.ERR_FeatureNotValidInExpressionTree, node, "__reftype");
            }

            return(base.VisitRefTypeOperator(node));
        }
示例#2
0
        public override BoundNode VisitRefTypeOperator(BoundRefTypeOperator node)
        {
            Debug.Assert((object)node.GetTypeFromHandle == null);

            var operand = (BoundExpression)this.Visit(node.Operand);
            var type    = this.VisitType(node.Type);

            // Emit needs this helper
            MethodSymbol getTypeFromHandle;

            if (!TryGetWellKnownTypeMember(node.Syntax, WellKnownMember.System_Type__GetTypeFromHandle, out getTypeFromHandle))
            {
                return(new BoundRefTypeOperator(node.Syntax, operand, null, type, hasErrors: true));
            }

            return(node.Update(operand, getTypeFromHandle, type));
        }