Skip to content

Commit c6a4dce

Browse files
committed
Allow value generics within the stdlib
Value Generics require support from libswiftCore, but that means it is always okay to use value generics within libswiftCore itself, since the runtime support is necessarily present.
1 parent 4231a36 commit c6a4dce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,10 @@ static void checkGenericParams(GenericContext *ownerCtx) {
568568
if (gp->isValue()) {
569569
// Value generic nominal types require runtime support.
570570
//
571+
// Stdlib/libswiftCore carries support for this feature
571572
// Embedded doesn't require runtime support for this feature.
572573
if (isa<NominalTypeDecl>(decl) &&
574+
!decl->getModuleContext()->isStdlibModule() &&
573575
!ctx.LangOpts.hasFeature(Feature::Embedded)) {
574576
TypeChecker::checkAvailability(
575577
gp->getSourceRange(),

0 commit comments

Comments
 (0)