[swift-users] ambiguous minus operator

J.E. Schotsman jeschot at xs4all.nl
Thu Feb 16 09:56:25 CST 2017


Hello,

I am trying to define an operator that subtracts dispatch times:

#import Dispatch

func -( time1: DispatchTime, time2: DispatchTime ) -> DispatchTimeInterval
	{
	return DispatchTimeInterval.nanoseconds( time2.uptimeNanoseconds - time1.uptimeNanoseconds )
	}

Compiler says: Ambiguous use of operator ‘-'
Found this candidate
Found this candidate

As usual the candidates are unknown.

What am I doing wrong?

Jan E.


More information about the swift-users mailing list