Open
Description
With this code:
struct S {}
func foo(_ x: S) {
_ = S?(x)
}
You get these index references:
/*
constructor=init()=s:3foo1SVACycfc=definition, implicit, childOf
struct=S=s:3foo1SV=definition
v */
struct S {}
/*
function=foo(_:)=s:3fooAAyyAA1SVF=definition
| parameter=x=s:3fooAAyyAA1SVF1xL_ACvp=definition, childOf
| | struct=S=s:3foo1SV=reference, containedBy
v v v */
func foo(_ x: S) {
/*
struct=S=s:3foo1SV=reference, containedBy
v */
_ = S?(x)
}
Where there should be a reference to the Optional constructor being called, which you do get with an explicit .init
:
/*
constructor=init()=s:3foo1SVACycfc=definition, implicit, childOf
struct=S=s:3foo1SV=definition
v */
struct S {}
/*
function=foo(_:)=s:3fooAAyyAA1SVF=definition
| parameter=x=s:3fooAAyyAA1SVF1xL_ACvp=definition, childOf
| | struct=S=s:3foo1SV=reference, containedBy
v v v */
func foo(_ x: S) {
/*
struct=S=s:3foo1SV=reference, containedBy
v */
_ = S?(x)
/*
struct=S=s:3foo1SV=reference, containedBy
| constructor=init(_:)=s:SqyxSgxcfc=reference, call, calledBy, containedBy
v v */
_ = S?.init(x)
}