IDE: Visual Studio X/Fire
Version: 10.0.0.2461 (develop)
Target (If relevant): Island(OSX)
Description:
Swift protocol properties default to nonmutating get
and mutating set
, but this can be explicitly changed to any combination of mutating
, nonmutating
and the WIP/Private __consuming
.
Expected Behavior:
Compiles.
Actual Behavior:
See below.
Steps:
protocol HasMutatingGetter {
var foo: Int { mutating get } // E374 "get" or "set" expected, got "mutating"
// E1 closing bracket expected, got "mutating"
// E375 One of "var", "func", "subscript", "typealias", "__event", "prefix", "postfix", "infix", "init", "associatedtype", expected, got "get"
// E1 closing bracket expected, got "get"
} // E477 Declaration expected
protocol HasNonMutatingSetter {
var foo: Int { get nonmutating set } // E1 closing bracket expected, got "nonmutating"
// E375 One of "var", "func", "subscript", "typealias", "__event", "prefix", "postfix", "infix", "init", "associatedtype", expected, got "set"
// E1 closing bracket expected, got "set"
} // E477 Declaration expected
protocol HasConsumingGetter {
var foo: Int { __consuming get } // E374 "get" or "set" expected, got "__consuming"
// E1 closing bracket expected, got "__consuming"
// E375 One of "var", "func", "subscript", "typealias", "__event", "prefix", "postfix", "infix", "init", "associatedtype", expected, got "get"
// E1 closing bracket expected, got "get"
} // E477 Declaration expected