File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -4869,11 +4869,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
48694869 PrintNameContext::FunctionParameterExternal);
48704870 Printer << " : " ;
48714871 } else if (Options.AlwaysTryPrintParameterLabels &&
4872- Param.hasInternalLabel ()) {
4872+ Param.hasInternalLabel () &&
4873+ !Param.getInternalLabel ().hasDollarPrefix ()) {
48734874 // We didn't have an external parameter label but were requested to
4874- // always try and print parameter labels. Print The internal label.
4875- // If we have neither an external nor an internal label, only print the
4876- // type.
4875+ // always try and print parameter labels.
4876+ // If the internal label is a valid internal parameter label (does not
4877+ // start with '$'), print the internal label. If we have neither an
4878+ // external nor a printable internal label, only print the type.
48774879 Printer << " _ " ;
48784880 Printer.printName (Param.getInternalLabel (),
48794881 PrintNameContext::FunctionParameterLocal);
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+
3+ // RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
4+ // RUN: %FileCheck %s < %t/main.swiftinterface
5+
6+ // CHECK: import Swift
7+
8+ // CHECK: public let MyClosureVar: (Swift.Int) -> Swift.Int
9+ public let MyClosureVar : ( Int ) -> Int = { $0 }
10+
11+ // CHECK: public var MyOtherClosureVar: (_ x: Swift.Int) -> Swift.Int
12+ public let MyOtherClosureVar : ( _ x: Int ) -> Int
You can’t perform that action at this time.
0 commit comments