Your code implies that attributes could be mutated if self.layoutInfo is non nil
Perhaps the warning is saying that no path leads to self.layoutInfo being non nil and hence attributes has no need of being a var.
Examine what conditions if any can lead to self.layoutInfo having data