SwiftSemantics Documentation Beta

Structure Operator

public struct Operator: Declaration, Hashable, Codable

An operator declaration.

%3 Operator Operator Hashable Hashable Operator->Hashable Declaration Declaration Operator->Declaration Codable Codable Operator->Codable ExpressibleBySyntax ExpressibleBySyntax Operator->ExpressibleBySyntax

Nested Types

Operator.Kind

The kind of operator (prefix, infix, or postfix).

Conforms To

Declaration

A Swift declaration.

ExpressibleBySyntax

A type that can be initialized with a Swift syntax node.

Codable
Hashable

Initializers

init(_:​)

public init(_ node: OperatorDeclSyntax)

Creates an instance initialized with the given syntax node.

Properties

attributes

let attributes: [Attribute]

The declaration attributes.

modifiers

let modifiers: [Modifier]

The declaration modifiers.

keyword

let keyword: String

The declaration keyword ("operator").

name

let name: String

The operator name.

kind

var kind: Kind

The kind of operator (prefix, infix, or postfix).