mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ASTPrinter: Remove printWithCompatibilityFeatureChecks() from printSynthesizedExtensionIfNeeded()
This path was not exercised in the test suite, and when the PrimaryAssociatedTypes feature finally (incorrectly) triggered it, it would print '#endifextension'.
This commit is contained in:
@@ -650,16 +650,7 @@ public:
|
||||
printer << " {}";
|
||||
};
|
||||
|
||||
bool printedNewline = false;
|
||||
if (printOptions.PrintCompatibilityFeatureChecks) {
|
||||
printedNewline =
|
||||
printWithCompatibilityFeatureChecks(printer, curPrintOptions,
|
||||
proto, printBody);
|
||||
} else {
|
||||
printBody();
|
||||
printedNewline = false;
|
||||
}
|
||||
if (!printedNewline)
|
||||
printer << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -typecheck -module-name ParameterizedProtocols -emit-module-interface-path %t/ParameterizedProtocols.swiftinterface %s
|
||||
// RUN: %FileCheck %s < %t/ParameterizedProtocols.swiftinterface
|
||||
|
||||
public struct S1 : P1 {
|
||||
public typealias T = Int
|
||||
}
|
||||
|
||||
public struct S2 : Q1 {}
|
||||
|
||||
protocol P1 : P2 {}
|
||||
|
||||
public protocol P2<T> {
|
||||
associatedtype T
|
||||
}
|
||||
|
||||
protocol Q1 : Q2 {}
|
||||
|
||||
public protocol Q2 {}
|
||||
|
||||
// CHECK: extension ParameterizedProtocols.S1 : ParameterizedProtocols.P2 {}
|
||||
// CHECK-NEXT: extension ParameterizedProtocols.S2 : ParameterizedProtocols.Q2 {}
|
||||
Reference in New Issue
Block a user