aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/ast/yql_expr.cpp
diff options
context:
space:
mode:
authorvvvv <vvvv@yandex-team.com>2025-02-05 15:50:36 +0300
committervvvv <vvvv@yandex-team.com>2025-02-05 16:11:38 +0300
commitb88a376d036ecf651261c1fd0357d78d151e0877 (patch)
tree5cbda9e3195e0a5762a6ea46c2ad426feca97eb7 /yql/essentials/ast/yql_expr.cpp
parentcb5cc9d6099ffd7e87ece77981034b0d3999baae (diff)
downloadydb-b88a376d036ecf651261c1fd0357d78d151e0877.tar.gz
YQL-19552 handle ErrorType before udf resolver call
commit_hash:68ac9a5d0f28d16201818ae27a56de211d8451ab
Diffstat (limited to 'yql/essentials/ast/yql_expr.cpp')
-rw-r--r--yql/essentials/ast/yql_expr.cpp127
1 files changed, 127 insertions, 0 deletions
diff --git a/yql/essentials/ast/yql_expr.cpp b/yql/essentials/ast/yql_expr.cpp
index 173dffd77f..dc05218ad4 100644
--- a/yql/essentials/ast/yql_expr.cpp
+++ b/yql/essentials/ast/yql_expr.cpp
@@ -3884,6 +3884,133 @@ TString NormalizeName(const TStringBuf& name) {
return result;
}
+void TDefaultTypeAnnotationVisitor::Visit(const TUnitExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TMultiExprType& type) {
+ for (const auto& i : type.GetItems()) {
+ i->Accept(*this);
+ }
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TTupleExprType& type) {
+ for (const auto& i : type.GetItems()) {
+ i->Accept(*this);
+ }
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TStructExprType& type) {
+ for (const auto& i : type.GetItems()) {
+ i->Accept(*this);
+ }
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TItemExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TListExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TStreamExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TFlowExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TDataExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TPgExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TWorldExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TOptionalExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TCallableExprType& type) {
+ type.GetReturnType()->Accept(*this);
+ for (const auto& arg : type.GetArguments()) {
+ arg.Type->Accept(*this);
+ }
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TResourceExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TTypeExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TDictExprType& type) {
+ type.GetKeyType()->Accept(*this);
+ type.GetPayloadType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TVoidExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TNullExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TGenericExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TTaggedExprType& type) {
+ type.GetBaseType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TErrorExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TVariantExprType& type) {
+ type.GetUnderlyingType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TEmptyListExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TEmptyDictExprType& type) {
+ Y_UNUSED(type);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TBlockExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+void TDefaultTypeAnnotationVisitor::Visit(const TScalarExprType& type) {
+ type.GetItemType()->Accept(*this);
+}
+
+TErrorTypeVisitor::TErrorTypeVisitor(TExprContext& ctx)
+ : Ctx_(ctx)
+{}
+
+void TErrorTypeVisitor::Visit(const TErrorExprType& type) {
+ HasErrors_ = true;
+ Ctx_.IssueManager.RaiseIssue(type.GetError());
+}
+
+bool TErrorTypeVisitor::HasErrors() {
+ return HasErrors_;
+}
+
} // namespace NYql
template<>