Skip to content

Commit bec3898

Browse files
committed
Only apply access level constraint if we have a nominal type
1 parent 12b27a1 commit bec3898

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/IRGen/GenType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,8 @@ SILType irgen::getSingletonAggregateFieldType(IRGenModule &IGM, SILType t,
22962296
// struct's.
22972297
if (fieldDecl->getEffectiveAccess() >= structDecl->getEffectiveAccess())
22982298
return fieldTy;
2299+
} else {
2300+
return fieldTy;
22992301
}
23002302
}
23012303

@@ -2319,6 +2321,8 @@ SILType irgen::getSingletonAggregateFieldType(IRGenModule &IGM, SILType t,
23192321
// enclosing struct's.
23202322
if (eltDecl->getEffectiveAccess() >= enumDecl->getEffectiveAccess())
23212323
return enumEltTy;
2324+
} else {
2325+
return enumEltTy;
23222326
}
23232327
}
23242328

0 commit comments

Comments
 (0)