File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -6685,17 +6685,6 @@ inline bool TypeBase::isOpenedExistential() const {
6685
6685
return isa<OpenedArchetypeType>(T);
6686
6686
}
6687
6687
6688
- inline bool TypeBase::isOpenedExistentialWithError () {
6689
- if (!hasOpenedExistential ())
6690
- return false ;
6691
-
6692
- CanType T = getCanonicalType ();
6693
- if (auto archetype = dyn_cast<OpenedArchetypeType>(T)) {
6694
- return archetype->getExistentialType ()->isExistentialWithError ();
6695
- }
6696
- return false ;
6697
- }
6698
-
6699
6688
inline bool TypeBase::canDynamicallyBeOptionalType (bool includeExistential) {
6700
6689
CanType T = getCanonicalType ();
6701
6690
auto isArchetypeOrExistential = isa<ArchetypeType>(T) ||
Original file line number Diff line number Diff line change @@ -1107,6 +1107,19 @@ bool TypeBase::isExistentialWithError() {
1107
1107
return layout.isExistentialWithError (getASTContext ());
1108
1108
}
1109
1109
1110
+ bool TypeBase::isOpenedExistentialWithError () {
1111
+ if (auto archetype = getAs<OpenedArchetypeType>()) {
1112
+ auto errorProto = getASTContext ().getErrorDecl ();
1113
+ if (!errorProto) return false ;
1114
+
1115
+ for (auto protoDecl : archetype->getConformsTo ()) {
1116
+ if (protoDecl == errorProto || protoDecl->inheritsFrom (errorProto))
1117
+ return true ;
1118
+ }
1119
+ }
1120
+ return false ;
1121
+ }
1122
+
1110
1123
bool TypeBase::isStdlibType () {
1111
1124
if (auto *NTD = getAnyNominal ()) {
1112
1125
auto *DC = NTD->getDeclContext ();
You can’t perform that action at this time.
0 commit comments