File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
CodeGeneration/Sources/Utils Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public extension Child {
5353 return InitializerClauseSyntax ( value: NilLiteralExprSyntax ( ) )
5454 }
5555 guard let token = token, isToken else {
56- return type. defaultInitialization . map { InitializerClauseSyntax ( value: $0) }
56+ return type. defaultValue . map { InitializerClauseSyntax ( value: $0) }
5757 }
5858 if token. isKeyword {
5959 return InitializerClauseSyntax ( value: ExprSyntax ( " . \( raw: token. swiftKind) () " ) )
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public extension Node {
5050
5151 /// Assuming this node has a single child without a default value, that child.
5252 var singleNonDefaultedChild : Child {
53- let nonDefaultedParams = children. filter { $0. type . defaultInitialization == nil }
53+ let nonDefaultedParams = children. filter { $0. defaultInitialization == nil }
5454 precondition ( nonDefaultedParams. count == 1 )
5555 return nonDefaultedParams [ 0 ]
5656 }
Original file line number Diff line number Diff line change @@ -50,10 +50,9 @@ public struct SyntaxBuildableType: Hashable {
5050 }
5151
5252 /// If the type has a default value (because it is optional or a token
53- /// with fixed test), return an expression of the form ` = defaultValue`
54- /// that can be used as the default value for a function parameter.
55- /// Otherwise, return the empty string.
56- public var defaultInitialization : ExprSyntax ? {
53+ /// with fixed test), return an expression that can be used as the
54+ /// default value for a function parameter. Otherwise, return `nil`.
55+ public var defaultValue : ExprSyntax ? {
5756 if isOptional {
5857 return ExprSyntax ( NilLiteralExprSyntax ( ) )
5958 } else if let token = token {
You can’t perform that action at this time.
0 commit comments