File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -565,14 +565,16 @@ static void checkGenericParams(GenericContext *ownerCtx) {
565565 hasPack = true ;
566566 }
567567
568- if (gp->isValue ()) {
569- // Value generic nominal types require runtime support.
570- //
571- // Stdlib/libswiftCore carries support for this feature
572- // Embedded doesn't require runtime support for this feature.
573- if (isa<NominalTypeDecl>(decl) &&
574- !decl->getModuleContext ()->isStdlibModule () &&
575- !ctx.LangOpts .hasFeature (Feature::Embedded)) {
568+ // Value generic nominal types require runtime support.
569+ if (gp->isValue () && isa<NominalTypeDecl>(decl)) {
570+ auto nomTypeDecl = cast<NominalTypeDecl>(decl);
571+ // But: Embedded doesn't require runtime support for this feature.
572+ // But: Stdlib/libswiftCore carries its own support,
573+ // so non-public stdlib declarations are safe
574+ if (!ctx.LangOpts .hasFeature (Feature::Embedded) &&
575+ !(decl->getModuleContext ()->isStdlibModule () &&
576+ !nomTypeDecl->isAccessibleFrom (nullptr ))) {
577+ // Everything else gets diagnosed for availability
576578 TypeChecker::checkAvailability (
577579 gp->getSourceRange (),
578580 ctx.getValueGenericTypeAvailability (),
You can’t perform that action at this time.
0 commit comments