Skip to content

Commit ba855ae

Browse files
committed
Sema: Map constraint type into context when building opened archetype in SIL mode
The '@opened ...' syntax only appears inside SIL function bodies, so we must map the superclass type into context in case the superclass type references outer generic parameters.
1 parent 1a637c6 commit ba855ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2755,6 +2755,8 @@ TypeResolver::resolveAttributedType(TypeAttributes &attrs, TypeRepr *repr,
27552755
diagnoseInvalid(repr, attrs.getLoc(TAK_opened), diag::opened_non_protocol,
27562756
ty);
27572757
} else {
2758+
ty = GenericEnvironment::mapTypeIntoContext(
2759+
resolution.getGenericSignature().getGenericEnvironment(), ty);
27582760
ty = OpenedArchetypeType::get(ty->getCanonicalType(), attrs.OpenedID);
27592761
}
27602762
attrs.clearAttribute(TAK_opened);

0 commit comments

Comments
 (0)