Problem getting Expectation objects (AI slop)

This is from an Xcode generated file.

var values: [String] = []
let exp = Expectation()
let c = pub.filter { $0 != nil }.map { $0! }.sink(

The second line gives an error: "'Expectation' cannot be constructed because it has no accessible initializers". My best guess that Expectation objects come from some other Apple Swift Testing function, but I don't know where.

I’m not sure what you’re asking for here. Are you trying to report a bug against Xcode? Or trying to work out how to use expectation-based tests in Swift Testing?

If it’s the former, I recommend that you do that officially, as explained in Bug Reporting: How and Why? And please post your bug number, just for the record.

If it’s the latter, see Expectations and confirmations.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Problem getting Expectation objects (AI slop)
 
 
Q