diff --git a/ets2panda/checker/ETSAnalyzer.cpp b/ets2panda/checker/ETSAnalyzer.cpp index 0a9631cdc351966944c84239e21f49102edce729..fb2f77ccf623708600636e843b2e65fed782eff0 100644 --- a/ets2panda/checker/ETSAnalyzer.cpp +++ b/ets2panda/checker/ETSAnalyzer.cpp @@ -1358,10 +1358,10 @@ checker::Type *ETSAnalyzer::Check(ir::MemberExpression *expr) const expr->Object()->Start()); } - if (!expr->IsOptional() && left_type->IsNullish()) { - checker->ThrowTypeError("The type of the object reference must be a non-nullish array or Record type", - expr->Object()->Start()); - } + // if (!expr->IsOptional() && left_type->IsNullish()) { + // checker->ThrowTypeError("The type of the object reference must be a non-nullish array or Record type", + // expr->Object()->Start()); + // } } auto *const base_type = expr->IsOptional() ? checker->GetNonNullishType(left_type) : left_type; diff --git a/ets2panda/checker/types/ets/etsUnionType.cpp b/ets2panda/checker/types/ets/etsUnionType.cpp index b3335689a18c33baa4b690a8167e8452716399ba..856db7b6617d8ce63dc65e57f8144740d1f3b3e6 100644 --- a/ets2panda/checker/types/ets/etsUnionType.cpp +++ b/ets2panda/checker/types/ets/etsUnionType.cpp @@ -37,6 +37,13 @@ void ETSUnionType::ToAssemblerType(std::stringstream &ss) const ss << compiler::Signatures::BUILTIN_OBJECT; } +void ETSUnionType::ToDebugInfoType(std::stringstream &ss) const +{ + for (const auto *t: this->ConstituentTypes()) { + t->ToDebugInfoType(ss); + } +} + bool ETSUnionType::EachTypeRelatedToSomeType(TypeRelation *relation, ETSUnionType *source, ETSUnionType *target) { return std::all_of(source->constituent_types_.begin(), source->constituent_types_.end(), diff --git a/ets2panda/checker/types/ets/etsUnionType.h b/ets2panda/checker/types/ets/etsUnionType.h index ce032fcef4712cb86bab8f42048c78a0057a698d..1ed636f5a37475f0076c893d88f22960be01bf86 100644 --- a/ets2panda/checker/types/ets/etsUnionType.h +++ b/ets2panda/checker/types/ets/etsUnionType.h @@ -62,6 +62,7 @@ public: void ToString(std::stringstream &ss) const override; void ToAssemblerType(std::stringstream &ss) const override; + void ToDebugInfoType(std::stringstream &ss) const override; void Identical(TypeRelation *relation, Type *other) override; void AssignmentTarget(TypeRelation *relation, Type *source) override; bool AssignmentSource(TypeRelation *relation, Type *target) override; diff --git a/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt b/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt index 771737bbd842586c93500fb0d517c443542c50f9..9452bf722aa7f182b86ef25d02d98dcfe10c5b64 100644 --- a/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt +++ b/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt @@ -709,4 +709,3 @@ } } } -TypeError: The type of the object reference must be a non-nullish array or Record type [array_indexing_without_chaining_nullish.ets:19:33]