Skip to content

Mark == and != unavailable#270

Merged
stephencelis merged 1 commit intomainfrom
unavailable-equals
Feb 19, 2026
Merged

Mark == and != unavailable#270
stephencelis merged 1 commit intomainfrom
unavailable-equals

Conversation

@stephencelis
Copy link
Copy Markdown
Member

We allow use right now but strongly advise against them, as the overloaded operators strain the compiler. But worse, they hide the triple-valued logic of SQL, which can lead to bugs.

So let's finally, in a breaking change, fully make these operators unavailable.

We allow use right now but strongly advise against them, as the
overloaded operators strain the compiler. But worse, they hide the
triple-valued logic of SQL, which can lead to bugs.

So let's finally, in a breaking change, fully make these operators
unavailable.
benefits of type-safety and expressivity in your queries, while also helping out Swift in compiling
your queries.

### Method operators
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can kill this doc since we found that == and != were the operators that strained the compiler the most in practice (we freely use &&, <, and others).

BinaryOperator(lhs: lhs, operator: "IS", rhs: rhs)
}

@available(*, deprecated, message: "Use 'is' instead.")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few of these are simply deprecated because they otherwise fall down to Swift's built-in == on optional values.

@stephencelis stephencelis merged commit afe02bf into main Feb 19, 2026
2 checks passed
@stephencelis stephencelis deleted the unavailable-equals branch February 19, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants