File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,8 @@ Optional<Type> GenericEnvironment::getMappingIfPresent(
86
86
87
87
Type GenericEnvironment::mapTypeIntoContext (GenericEnvironment *env,
88
88
Type type) {
89
- assert (!type->hasArchetype () && " already have a contextual type" );
89
+ assert ((!type->hasArchetype () || type->hasOpenedExistential ()) &&
90
+ " already have a contextual type" );
90
91
assert ((env || !type->hasTypeParameter ()) &&
91
92
" no generic environment provided for type with type parameters" );
92
93
@@ -230,8 +231,8 @@ Type QueryInterfaceTypeSubstitutions::operator()(SubstitutableType *type) const{
230
231
Type GenericEnvironment::mapTypeIntoContext (
231
232
Type type,
232
233
LookupConformanceFn lookupConformance) const {
233
- assert (!type->hasOpenedExistential () &&
234
- " Opened existentials are special and so are you " );
234
+ assert (( !type->hasArchetype () || type-> hasOpenedExistential () ) &&
235
+ " already have a contextual type " );
235
236
236
237
Type result = type.subst (QueryInterfaceTypeSubstitutions (this ),
237
238
lookupConformance,
You can’t perform that action at this time.
0 commit comments