Initializerswift-testing 6.0.2Testing
init(_:)
Initialize an instance of this type containing the specified source code.
Expression.swift:519This declaration is gated by at least one @_spi attribute.
init(_ sourceCode: String)
Parameters
- sourceCode
The source code of the expression being described.
To get the string value of an expression, pass it to String.init(describing:)
.
This initializer does not attempt to parse sourceCode
.
Other members in extension
Types
Show system interfaces (1)
Hide system interfaces
struct Value
A type which represents an evaluated value, which may include textual descriptions, type information, substructure, and other information.
Type members
Show implementation details (7)
Hide implementation details
init(from: any Decoder
) throws static func __fromBinaryOperation(`Self`, String, `Self`
) -> __Expression Create an instance of this type representing a binary operation.
static func __fromFunctionCall(`Self`?, String, (label: String?, value: `Self`)...
) -> __Expression Create an instance of this type representing a function call.
static func __fromNegation(`Self`, Bool
) -> __Expression Create an instance of this type representing a negated expression using the
!
operator..static func __fromPropertyAccess(`Self`, `Self`
) -> __Expression Create an instance of this type representing a property access.
static func __fromStringLiteral(String, String
) -> __Expression Create an instance of this type representing a string literal.
static func __fromSyntaxNode(String
) -> __Expression Create an instance of this type representing a complete syntax node.
Instance members
Show implementation details (2)
Hide implementation details
Show system interfaces (5)
Hide system interfaces
var runtimeValue: Value?
A representation of the runtime value of this expression.
var sourceCode: String
The source code of the original captured expression.
var stringLiteralValue: String?
The string value associated with this instance if it represents a string literal.
var subexpressions: [`Self`]
The set of parsed and captured subexpressions contained in this instance.
func expandedDescription(
) -> String Get an expanded description of this instance that contains the source code and runtime value (or values) it represents.