public override object VisitWhileStatement([NotNull] WhileStatementContext context) { var type = TypeVisitor.GetType(context.expression(), scope, errors); if (!type.InheritsFrom(TypeSystem.Instance["Boolean"])) { errors.Add(new Error(context, $"Expression type must be {TypeSystem.Instance["Boolean"]}")); } return(base.VisitWhileStatement(context)); }