Files
swift-mirror/test/SourceKit/ConformingMethods/basic.swift
Rintaro Ishizaki 8307c6a95c [SourceKit] Report 'key.reusingastcontext' in completion like requests
'TypeContextInfo' and 'ConformingMethodList'
2020-06-29 10:21:32 -07:00

31 lines
817 B
Swift

protocol Target1 {}
protocol Target2 {}
protocol Target3 {}
struct ConcreteTarget1 : Target1 {}
struct ConcreteTarget2 : Target2 {}
struct ConcreteTarget3 : Target3 {}
protocol P {
associatedtype Assoc
func protocolMethod(asc: Assoc) -> Self
}
extension P {
func protocolMethod(asc: Assoc) -> Self { return self }
}
class C : P {
typealias Assoc = String
static func staticMethod() -> Self {}
func instanceMethod(x: Int) -> C {}
func methodForTarget1() -> ConcreteTarget1 {}
func methodForTarget2() -> ConcreteTarget2 {}
}
func testing(obj: C) {
let _ = obj.
}
// RUN: %sourcekitd-test -req=conformingmethods -pos=26:14 -repeat-request=2 %s -req-opts=expectedtypes='$s8MyModule7Target2PD;$s8MyModule7Target1PD' -- -module-name MyModule %s > %t.response
// RUN: %diff -u %s.response %t.response