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 @@ -6689,17 +6689,6 @@ inline bool TypeBase::isOpenedExistential() const {
6689
6689
return isa<OpenedArchetypeType>(T);
6690
6690
}
6691
6691
6692
- inline bool TypeBase::isOpenedExistentialWithError () {
6693
- if (!hasOpenedExistential ())
6694
- return false ;
6695
-
6696
- CanType T = getCanonicalType ();
6697
- if (auto archetype = dyn_cast<OpenedArchetypeType>(T)) {
6698
- return archetype->getExistentialType ()->isExistentialWithError ();
6699
- }
6700
- return false ;
6701
- }
6702
-
6703
6692
inline bool TypeBase::canDynamicallyBeOptionalType (bool includeExistential) {
6704
6693
CanType T = getCanonicalType ();
6705
6694
auto isArchetypeOrExistential = isa<ArchetypeType>(T) ||
Original file line number Diff line number Diff line change @@ -1113,6 +1113,19 @@ bool TypeBase::isExistentialWithError() {
1113
1113
return layout.isExistentialWithError (getASTContext ());
1114
1114
}
1115
1115
1116
+ bool TypeBase::isOpenedExistentialWithError () {
1117
+ if (auto archetype = getAs<OpenedArchetypeType>()) {
1118
+ auto errorProto = getASTContext ().getErrorDecl ();
1119
+ if (!errorProto) return false ;
1120
+
1121
+ for (auto protoDecl : archetype->getConformsTo ()) {
1122
+ if (protoDecl == errorProto || protoDecl->inheritsFrom (errorProto))
1123
+ return true ;
1124
+ }
1125
+ }
1126
+ return false ;
1127
+ }
1128
+
1116
1129
bool TypeBase::isStdlibType () {
1117
1130
if (auto *NTD = getAnyNominal ()) {
1118
1131
auto *DC = NTD->getDeclContext ();
You can’t perform that action at this time.
0 commit comments