diff options
author | aneporada <aneporada@ydb.tech> | 2022-10-03 13:13:33 +0300 |
---|---|---|
committer | aneporada <aneporada@ydb.tech> | 2022-10-03 13:13:33 +0300 |
commit | 8802f8ecdbe8bb031f90d7ecc6aeccfd373b1c84 (patch) | |
tree | 7f0e492f1349efd1e2a00a437dceb172820fef45 | |
parent | f9e98c0e214e6e002975813a7caf4887144a8369 (diff) | |
download | ydb-8802f8ecdbe8bb031f90d7ecc6aeccfd373b1c84.tar.gz |
Fix handling of ErrorType in CommonType()
-rw-r--r-- | ydb/library/yql/core/yql_expr_type_annotation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ydb/library/yql/core/yql_expr_type_annotation.cpp b/ydb/library/yql/core/yql_expr_type_annotation.cpp index 38a2b73a51..de7da96eeb 100644 --- a/ydb/library/yql/core/yql_expr_type_annotation.cpp +++ b/ydb/library/yql/core/yql_expr_type_annotation.cpp @@ -1630,6 +1630,10 @@ const TTypeAnnotationNode* CommonType(TPositionHandle pos, const TTypeAnnotation if (!(one && two)) return nullptr; + if (HasError(one, ctx) || HasError(two, ctx)) { + return nullptr; + } + if (IsSameAnnotation(*one, *two)) return two; @@ -1660,6 +1664,8 @@ const TTypeAnnotationNode* CommonType(TPositionHandle pos, const TTypeAnnotation default: break; } + + ctx.AddError(TIssue(ctx.GetPosition(pos), TStringBuilder() << "Cannot infer common type for " << kindOne)); } else { if constexpr (!Strict) { if (ETypeAnnotationKind::Pg == kindOne) { |