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 @@ -4894,11 +4894,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
4894
4894
PrintNameContext::FunctionParameterExternal);
4895
4895
Printer << " : " ;
4896
4896
} else if (Options.AlwaysTryPrintParameterLabels &&
4897
- Param.hasInternalLabel ()) {
4897
+ Param.hasInternalLabel () &&
4898
+ !Param.getInternalLabel ().hasDollarPrefix ()) {
4898
4899
// We didn't have an external parameter label but were requested to
4899
- // always try and print parameter labels. Print The internal label.
4900
- // If we have neither an external nor an internal label, only print the
4901
- // type.
4900
+ // always try and print parameter labels.
4901
+ // If the internal label is a valid internal parameter label (does not
4902
+ // start with '$'), print the internal label. If we have neither an
4903
+ // external nor a printable internal label, only print the type.
4902
4904
Printer << " _ " ;
4903
4905
Printer.printName (Param.getInternalLabel (),
4904
4906
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