mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The removal of these operator declarations caused a source compatibility break, because some Swift code is defining prefix or postfix ++/-- functions without defining the ++ or -- operators. Reinstate the operator declarations in the standard library... but not any of the functions. Fixes rdar://problem/43258773.
11 lines
255 B
Swift
11 lines
255 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 4
|
|
|
|
// expect-no-diagnostics
|
|
|
|
struct X { }
|
|
|
|
postfix func ++(x: X) -> X { return x }
|
|
prefix func ++(x: X) -> X { return x }
|
|
postfix func --(x: X) -> X { return x }
|
|
prefix func --(x: X) -> X { return x }
|