Here is a stripped down example of a section of my code base.
struct S {
var set = [0]
var x: Int? {
return set.first
}
}
I would like to standardize by removing return
from single-statement functions and getters, and I found that the code above fails to compile when return
is removed.
error: AV.playground:8:12: error: expected '{' to start setter definition
set.first
This is obviously an interaction between the parser and my choice of variable name. The token set
is expected to begin a setter, and is not recognized as a variable name.