Commit 689781d
committed
refactor: add @_disfavoredOverload to .min()/.max() methods in BasicMath
Added `@_disfavoredOverload` attribute to QueryExpression.min() and
QueryExpression.max() methods to prevent conflicts with Swift's stdlib
Sequence.min() and Sequence.max() methods.
Changes:
- Added @_disfavoredOverload to all four .min()/.max() methods in BasicMath.swift
- Added documentation explaining the disambiguation approach
- Created comprehensive test suite (BasicMathTests.swift) with 25 tests
- Tests demonstrate both Swift stdlib and SQL methods working together
- All 860 tests passing (including 25 new tests)
Benefits:
- Users can use Swift's .min()/.max() on regular Swift collections
- Users can use SQL's .min()/.max() on QueryExpression types
- No explicit type annotations needed
- Consistent with existing .joined() disambiguation pattern1 parent bc06e1f commit 689781d
File tree
3 files changed
+380
-0
lines changed- Sources/StructuredQueriesPostgres/Functions/Mathematical
- Tests/StructuredQueriesPostgresTests
- Functions/Mathematical
- Support
3 files changed
+380
-0
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| |||
288 | 291 | | |
289 | 292 | | |
290 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
| |||
305 | 312 | | |
306 | 313 | | |
307 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
308 | 318 | | |
309 | 319 | | |
310 | 320 | | |
| |||
315 | 325 | | |
316 | 326 | | |
317 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
318 | 332 | | |
319 | 333 | | |
320 | 334 | | |
| |||
0 commit comments