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