[swift-users] ambiguous minus operator

Jon Shier jon at jonshier.com
Thu Feb 16 12:22:59 CST 2017


	I’ve had good luck with being able to click the candidates in cases like this so Xcode will navigate to those bits of code. However, in this case I think the issue is that the candidates weren’t from user code but from the standard library, which Xcode has all sorts of issues navigating within, seemingly at random.
	As an aside, it would be really cool if, instead of seeing the standard library as a compiled module, Xcode could navigate to the relevant source code (perhaps optionally). Otherwise I’m stuck either looking at documentation (Apple’s docs or swiftdocs) and if that doesn’t help, trying to navigate to the relevant code in GitHub. This is especially true for things like finding out what the default values defined for functions are, as the documentation just shows default, which is useless.


Jon

> On Feb 16, 2017, at 1:16 PM, Jordan Rose via swift-users <swift-users at swift.org> wrote:
> 
>> As usual the candidates are unknown.
> 
> Just on this particular note, this is a terrible presentation issue and totally something we Apple people need to fix in Xcode, but you can usually see what the candidates were in the build log.
> 
> Jordan
> 
> 
>> On Feb 16, 2017, at 07:56, J.E. Schotsman via swift-users <swift-users at swift.org> wrote:
>> 
>> 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.
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users



More information about the swift-users mailing list