public BoundIfElseStatement( BoundExpression boundExpression, BoundScopeStatement boundStatements, BoundScopeStatement elseBoundStatements, IfElseStatementSyntax statementSyntax) : base(statementSyntax) { BoundExpression = boundExpression; BoundStatements = boundStatements; ElseBoundStatements = elseBoundStatements; }
private BoundStatement BindIfElseStatement(IfElseStatementSyntax syntax) { var boundExpression = BindExpression(syntax.Condition); Ensure(() => TypeEquals(boundExpression.Type, new BoolCompilerGeneratedType()), "If condition must be of Type Bool"); var boundStatements = BindScope(syntax.Statements); var boundElseStatement = BindScope(syntax.ElseStatements); return new BoundIfElseStatement(boundExpression, boundStatements, boundElseStatement, syntax); }