Hi, I am having problems with code like this:
public struct MyStruct {
public let rawValue: Int
public init(rawValue: Int) {
self.rawValue = rawValue;
}
}
public func makeStruct(value: Int) -> MyStruct {
// Compile error on this line
// error E110: Ambiguous call to overloaded method "<Constructor>"
return MyStruct(rawValue: value)
}
let s = makeStruct(value: 5)
print("Struct has value \(s.rawValue)")
Is there any reason why this shouldn’t work? I think it might be a bug. I’m targeting Android using Fire 9.1.99.2141. This is a sample project with this code: StructInit.zip (377.8 KB)
Thanks!