I have a simple swift script that I wrote and created a docker image containing this script. The script makes a network call using
URLSession and operates on the data to determine success/failure of the script. I wanted to try out migrating this to using async/await, so I changed the base image of my dockerfile to
swiftlang/swift:nightly-5.5-bionic, however when running my
swiftc command as part of the
docker build, I am getting the output below:
#8 1.211 main.swift:43:32: error: type of expression is ambiguous without more context #8 1.211 let (data, response) = try await URLSession.shared.data(with: request) #8 1.211 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am not sure what I am doing wrong, but maybe there are more steps to enable concurrency features. Any help would be really appreciated.