protospec_build/asg/expression/
ternary.rs

1use super::*;
2
3#[derive(PartialEq, Clone, Debug)]
4pub struct TernaryExpression {
5    pub condition: Box<Expression>,
6    pub if_true: Box<Expression>,
7    pub if_false: Box<Expression>,
8    pub span: Span,
9}
10
11impl AsgExpression for TernaryExpression {
12    fn get_type(&self) -> Option<Type> {
13        self.if_true.get_type().or_else(|| self.if_false.get_type())
14    }
15}