Compiler:
RemObjects Elements (RemObjects C# and Oxygene) Compiler for .NET, Cocoa and Java - Version 8.1.85.1801
calling a method without parameter having default value in its signature, causing compiler error
: error E0: Internal error: Argument is out of range.
Parameter name: index
extension CGRect {
init(x: CGFloat, y:CGFloat, width:CGFloat, height:CGFloat, pixelAlign:Bool = false) {
if !pixelAlign {
self.origin.x = x
self.origin.y = y
self.size.width = width
self.size.height = height
} else {
let scale = UIScreen.mainScreen().scale
self.origin.x = floor(x * scale) / scale
self.origin.y = floor(y * scale) / scale
self.size.width = ceil(width * scale) / scale
self.size.height = ceil(height * scale) / scale
}
}
}
// Use case
let rect = CGRect(x: 0, y: 0, width: 320, height: 44)
compiler didn’t provide any useful information, other than error:E0.
I have found this through trial & error.
// adding the default parameter to the call fixes E0 error
let rect = CGRect(x: 0, y: 0, width: 320, height: 44, pixelAlign: false)