@@ -729,34 +729,6 @@ getOrSynthesizeTangentVectorStruct(DerivedConformance &derived, Identifier id) {
729
729
return structDecl;
730
730
}
731
731
732
- // / Add a typealias declaration with the given name and underlying target
733
- // / struct type to the given source nominal declaration context.
734
- static void addAssociatedTypeAliasDecl (Identifier name, DeclContext *sourceDC,
735
- StructDecl *target,
736
- ASTContext &Context) {
737
- auto *nominal = sourceDC->getSelfNominalTypeDecl ();
738
- assert (nominal && " Expected `DeclContext` to be a nominal type" );
739
- auto lookup = nominal->lookupDirect (name);
740
- assert (lookup.size () < 2 &&
741
- " Expected at most one associated type named member" );
742
- // If implicit type declaration with the given name already exists in source
743
- // struct, return it.
744
- if (lookup.size () == 1 ) {
745
- auto existingTypeDecl = dyn_cast<TypeDecl>(lookup.front ());
746
- assert (existingTypeDecl && existingTypeDecl->isImplicit () &&
747
- " Expected lookup result to be an implicit type declaration" );
748
- return ;
749
- }
750
- // Otherwise, create a new typealias.
751
- auto *aliasDecl = new (Context)
752
- TypeAliasDecl (SourceLoc (), SourceLoc (), name, SourceLoc (), {}, sourceDC);
753
- aliasDecl->setUnderlyingType (target->getDeclaredInterfaceType ());
754
- aliasDecl->setImplicit ();
755
- aliasDecl->setGenericSignature (sourceDC->getGenericSignatureOfContext ());
756
- cast<IterableDeclContext>(sourceDC->getAsDecl ())->addMember (aliasDecl);
757
- aliasDecl->copyFormalAccessFrom (nominal, /* sourceIsParentContext*/ true );
758
- };
759
-
760
732
// / Diagnose stored properties in the nominal that do not have an explicit
761
733
// / `@noDerivative` attribute, but either:
762
734
// / - Do not conform to `Differentiable`.
@@ -855,9 +827,6 @@ getOrSynthesizeTangentVectorStructType(DerivedConformance &derived) {
855
827
return nullptr ;
856
828
// Check and emit warnings for implicit `@noDerivative` members.
857
829
checkAndDiagnoseImplicitNoDerivative (C, nominal, parentDC);
858
- // Add `TangentVector` typealias for `TangentVector` struct.
859
- addAssociatedTypeAliasDecl (C.Id_TangentVector , tangentStruct, tangentStruct,
860
- C);
861
830
862
831
// Return the `TangentVector` struct type.
863
832
return parentDC->mapTypeIntoContext (
0 commit comments