Skip to content

Commit 1341739

Browse files
authored
Merge pull request #2653 from DougGregor/use-before-define
Don't use an instance property before it's defined
2 parents 4cc5c53 + fb7680c commit 1341739

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftSyntax/TokenDiagnostic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ public struct TokenDiagnostic: Hashable, Sendable {
129129
/// expect to hit this case most of the time.
130130
public init(_ kind: Kind, byteOffset: Int) {
131131
precondition(byteOffset >= 0)
132-
// `type(of: self.byteOffset).max` gets optimized to a constant
133-
if byteOffset > type(of: self.byteOffset).max {
132+
// `UInt16.max` gets optimized to a constant
133+
if byteOffset > UInt16.max {
134134
self.kind = .tokenDiagnosticOffsetOverflow
135135
self.byteOffset = 0
136136
} else {

0 commit comments

Comments
 (0)