Files
swift-mirror/test/Compatibility/operators.swift
Doug Gregor 61d1ab9ea1 [Standard library] Reintroduce operator declarations for pre/postfix ++/--.
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.
2018-08-24 13:45:50 -07:00

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 }