Open leiguang opened 3 years ago
@leiguang Do you found the solution ? i have this problem too
same
My work around:
I moved randomFloat
-constant outside of the generateRealisticCharSet
-func (and removed the duplicate in generateCharSetFromImages
), updated the randomFloat
to self.randomFloat
.
simply split the expression to multiple parts:
let randomFloat: (CGFloat) -> CGFloat = { modi in
let temp = (0 - modi) + CGFloat(arc4random())
let temp2 = CGFloat(UINT32_MAX) * (modi * 2)
return temp / temp2
}
error: the compiler is unable to type-check this expression. solution: explicitly declare the type of Modi { (modi: CGFloat) in ... }