@@ -29,8 +29,8 @@ var y : Y
29
29
30
30
func += ( lhs: inout X , rhs : X ) { }
31
31
func += ( lhs: inout Double , rhs : Double ) { }
32
- prefix func ++ ( rhs : inout X ) { }
33
- postfix func ++ ( lhs : inout X ) { }
32
+ prefix operator +++
33
+ prefix func +++ ( rhs : inout X ) { }
34
34
35
35
f0 ( & i)
36
36
f1 ( & i)
@@ -44,7 +44,7 @@ f1(y[i]) // expected-error{{passing value of type 'Float' to an inout parameter
44
44
45
45
// Assignment operators
46
46
x += x
47
- ++ x
47
+ +++ x
48
48
49
49
var yi = y [ i]
50
50
@@ -77,28 +77,28 @@ f2(&non_settable_x) // expected-error{{cannot pass immutable value as inout argu
77
77
f1 ( & non_settable_x) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
78
78
// - inout assignment
79
79
non_settable_x += x // expected-error{{left side of mutating operator isn't mutable: 'non_settable_x' is a get-only property}}
80
- ++ non_settable_x // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
80
+ +++ non_settable_x // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
81
81
82
82
// non-settable property is non-settable:
83
83
z. non_settable_x = x // expected-error{{cannot assign to property: 'non_settable_x' is a get-only property}}
84
84
f2 ( & z. non_settable_x) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
85
85
f1 ( & z. non_settable_x) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
86
86
z. non_settable_x += x // expected-error{{left side of mutating operator isn't mutable: 'non_settable_x' is a get-only property}}
87
- ++ z. non_settable_x // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
87
+ +++ z. non_settable_x // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
88
88
89
89
// non-settable subscript is non-settable:
90
90
z [ 0 ] = 0.0 // expected-error{{cannot assign through subscript: subscript is get-only}}
91
91
f2 ( & z[ 0 ] ) // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}}
92
92
f1 ( & z[ 0 ] ) // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}}
93
93
z [ 0 ] += 0.0 // expected-error{{left side of mutating operator isn't mutable: subscript is get-only}}
94
- ++ z[ 0 ] // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}}
94
+ +++ z [ 0 ] // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}}
95
95
96
96
// settable property of an rvalue value type is non-settable:
97
97
fz ( ) . settable_x = x // expected-error{{cannot assign to property: 'fz' returns immutable value}}
98
98
f2 ( & fz( ) . settable_x) // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}}
99
99
f1 ( & fz( ) . settable_x) // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}}
100
100
fz ( ) . settable_x += x // expected-error{{left side of mutating operator isn't mutable: 'fz' returns immutable value}}
101
- ++ fz( ) . settable_x // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}}
101
+ +++ fz ( ) . settable_x // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}}
102
102
103
103
// settable property of an rvalue reference type IS SETTABLE:
104
104
fref ( ) . property = 0.0
@@ -112,7 +112,7 @@ z.non_settable_x.property = 1.0 // expected-error{{cannot assign to property: 'n
112
112
f2 ( & z. non_settable_x. property) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
113
113
f1 ( & z. non_settable_x. property) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
114
114
z. non_settable_x. property += 1.0 // expected-error{{left side of mutating operator isn't mutable: 'non_settable_x' is a get-only property}}
115
- ++ z. non_settable_x. property // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
115
+ +++ z. non_settable_x. property // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}}
116
116
117
117
// settable property of a non-settable reference type IS SETTABLE:
118
118
z. non_settable_reftype. property = 1.0
0 commit comments