Alamofire: Ambiguous use of 'Task'

Created on 14 Nov 2016  路  10Comments  路  Source: Alamofire/Alamofire

open func suspend() {
    guard let task = task else { return }

    task.suspend()

    NotificationCenter.default.post(
        name: Notification.Name.Task.DidSuspend,
        object: self,
        userInfo: [Notification.Key.Task: task]  <- here
    )
}

/// Cancels the request.
open override func cancel() {
    downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 }

    NotificationCenter.default.post(
        name: Notification.Name.Task.DidCancel,
        object: self,
        userInfo: [Notification.Key.Task: task as Any]  <- here
    )
}

alamofire is compiled. (ok)
but in my project (failed)

here -> userInfo: [Notification.Key.Task: task as Any]

5's error

Ambiguous use of 'Task'
Request.swift
Ambiguous use of 'Task'
SessionDelegate.swift

question

Most helpful comment

Experiencing same issue on 4.4.0

All 10 comments

I'm experiencing the identical issue. Does anyone know a good work-around with swift3?

This issue is fixed in the master branch and will be released shortly as Alamofire 4.1.0.

Cheers. 馃嵒

Experiencing same issue on 4.4.0

Experiencing this as well on 4.4.0

Same 5 errors.

same issue on 4.4.0

same issue on 4.4.0

Same here

same issue on 4.5.0

samen issue on 4.8.1 !!!

Same here

Was this page helpful?
0 / 5 - 0 ratings