public override BoundNode VisitSwitchOperator(BoundSwitchOperator node) { // TODO: Implement lowering for switch operator. return(MakeLiteral(node.Syntax, ConstantValue.Create($"CodeGen not yet implemented for: '{node.Syntax.ToString()}'"), _compilation.GetSpecialType(SpecialType.System_String))); }
/// <summary> /// Rewrite switch operator into nested conditional operators. /// </summary> public override BoundNode VisitSwitchOperator(BoundSwitchOperator node) { // just a fact, not a requirement (VisitExpression would have rewritten otherwise) Debug.Assert(node.ConstantValue == null); var rewrittenExpression = VisitExpression(node.Expression); var rewrittenLabels = node.Labels.SelectAsArray(l => VisitExpression(l)); var rewrittenValues = node.Values.SelectAsArray(l => VisitExpression(l)); var rewrittenType = VisitType(node.Type); var booleanType = _compilation.GetSpecialType(SpecialType.System_Boolean); return(RewriteSwitchOperator( node.Syntax, rewrittenExpression, rewrittenLabels, rewrittenValues, rewrittenType, booleanType)); }
public override BoundNode VisitSwitchOperator(BoundSwitchOperator node) { // TODO: Implement flow analysis for switch operator. return(null); }