@@ -516,19 +516,13 @@ getOrSynthesizeTangentVectorStruct(DerivedConformance &derived, Identifier id) {
516
516
auto *tangentEqualsSelfAlias = new (C) TypeAliasDecl (
517
517
SourceLoc (), SourceLoc (), C.Id_TangentVector , SourceLoc (),
518
518
/* GenericParams*/ nullptr , structDecl);
519
- tangentEqualsSelfAlias->setUnderlyingType (structDecl->getSelfTypeInContext ());
520
- tangentEqualsSelfAlias->setAccess (structDecl->getFormalAccess ());
519
+ tangentEqualsSelfAlias->setUnderlyingType (structDecl->getDeclaredInterfaceType ());
520
+ tangentEqualsSelfAlias->copyFormalAccessFrom (structDecl,
521
+ /* sourceIsParentContext*/ true );
521
522
tangentEqualsSelfAlias->setImplicit ();
522
523
tangentEqualsSelfAlias->setSynthesized ();
523
524
structDecl->addMember (tangentEqualsSelfAlias);
524
525
525
- // If nominal type is `@usableFromInline`, also mark `TangentVector` struct.
526
- if (nominal->getAttrs ().hasAttribute <UsableFromInlineAttr>()) {
527
- structDecl->getAttrs ().add (new (C) UsableFromInlineAttr (/* implicit*/ true ));
528
- tangentEqualsSelfAlias->getAttrs ().add (
529
- new (C) UsableFromInlineAttr (/* implicit*/ true ));
530
- }
531
-
532
526
// The implicit memberwise constructor must be explicitly created so that it
533
527
// can called in `AdditiveArithmetic` and `Differentiable` methods. Normally,
534
528
// the memberwise constructor is synthesized during SILGen, which is too late.
0 commit comments