Skip to content

Commit b911b80

Browse files
committed
AST: Remove unused and incorrect BridgedASTType::subst()
1 parent 3b83ac3 commit b911b80

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

SwiftCompilerSources/Sources/AST/Type.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ public struct Type: TypeProperties, CustomStringConvertible, NoReflectionChildre
6464
public func subst(with substitutionMap: SubstitutionMap) -> Type {
6565
return Type(bridged: bridged.subst(substitutionMap.bridged))
6666
}
67-
68-
public func subst(type: Type, with targetType: Type) -> Type {
69-
return Type(bridged: bridged.subst(type.bridged, targetType.bridged))
70-
}
7167
}
7268

7369
/// A Type that is statically known to be canonical.
@@ -88,10 +84,6 @@ public struct CanonicalType: TypeProperties, CustomStringConvertible, NoReflecti
8884
public func subst(with substitutionMap: SubstitutionMap) -> CanonicalType {
8985
return rawType.subst(with: substitutionMap).canonical
9086
}
91-
92-
public func subst(type: CanonicalType, with targetType: CanonicalType) -> CanonicalType {
93-
return self.rawType.subst(type: type.rawType, with: targetType.rawType).canonical
94-
}
9587
}
9688

9789
/// Implements the common members of `AST.Type`, `AST.CanonicalType` and `SIL.Type`.

include/swift/AST/ASTBridging.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3115,7 +3115,6 @@ struct BridgedASTType {
31153115
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedSubstitutionMap getContextSubstitutionMap() const;
31163116
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGenericSignature getInvocationGenericSignatureOfFunctionType() const;
31173117
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType subst(BridgedSubstitutionMap substMap) const;
3118-
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType subst(BridgedASTType fromType, BridgedASTType toType) const;
31193118
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformance checkConformance(BridgedDeclObj proto) const;
31203119
};
31213120

include/swift/AST/ASTBridgingImpl.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -596,17 +596,6 @@ BridgedASTType BridgedASTType::subst(BridgedSubstitutionMap substMap) const {
596596
return {unbridged().subst(substMap.unbridged()).getPointer()};
597597
}
598598

599-
600-
BridgedASTType BridgedASTType::subst(BridgedASTType fromType, BridgedASTType toType) const {
601-
auto *fromTy = fromType.unbridged()->castTo<swift::SubstitutableType>();
602-
swift::Type toTy = toType.unbridged();
603-
return {unbridged().subst([fromTy, toTy](swift::SubstitutableType *t) -> swift::Type {
604-
if (t == fromTy)
605-
return toTy;
606-
return t;
607-
}, swift::LookUpConformanceInModule(), swift::SubstFlags::SubstituteLocalArchetypes).getPointer()};
608-
}
609-
610599
BridgedConformance BridgedASTType::checkConformance(BridgedDeclObj proto) const {
611600
return swift::checkConformance(unbridged(), proto.getAs<swift::ProtocolDecl>(), /*allowMissing=*/ false);
612601
}

0 commit comments

Comments
 (0)