File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
test/SourceKit/CursorInfo Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5109,6 +5109,14 @@ ParamDecl::getDefaultValueStringRepresentation(
5109
5109
DefaultValueAndIsVariadic.getPointer ()->StringRepresentation ;
5110
5110
if (!existing.empty ())
5111
5111
return existing;
5112
+
5113
+ if (!getDefaultValue ()) {
5114
+ // TypeChecker::checkDefaultArguments() nulls out the default value
5115
+ // if it fails to type check it. This only seems to happen with an
5116
+ // invalid/incomplete parameter list that contains a parameter with an
5117
+ // unresolved default value.
5118
+ return " <<empty>>" ;
5119
+ }
5112
5120
return extractInlinableText (getASTContext ().SourceMgr , getDefaultValue (),
5113
5121
scratch);
5114
5122
}
Original file line number Diff line number Diff line change
1
+ enum LogLevel { case error }
2
+
3
+ func logAsync( level: LogLevel = undefined, messageProducer producer
4
+
5
+ // RUN: %sourcekitd-test -req=cursor -pos=3:44 %s -- %s | %FileCheck %s
6
+
7
+ // CHECK: source.lang.swift.decl.function.free (3:6-3:68)
8
+ // CHECK: logAsync(level:messageProducer:)
9
+ // CHECK: LogLevel</Type> = <<empty>>
You can’t perform that action at this time.
0 commit comments