mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The root cause is that NormalProtocolConformance::forEachValueWitness() needs to skip protocol members that are not requirements. Otherwise we end up passing such a non-requirement member down to NormalProtocolConformance::getWitness() and hit an assert when we cannot find it. It looks like this code path was only ever hit from SourceKit. The fix moves TypeChecker::isRequirement() to a method on ValueDecl, and calls it in the right places. Fixes <https://bugs.swift.org/browse/SR-3815>.
14 lines
255 B
Swift
14 lines
255 B
Swift
// RUN: %sourcekitd-test -req=index %s -- -serialize-diagnostics-path %t.dia %s | %sed_clean > %t.response
|
|
// RUN: diff -u %s.response %t.response
|
|
|
|
protocol P {
|
|
typealias Index = Int
|
|
func f()
|
|
}
|
|
|
|
struct S : P {
|
|
typealias Index = Int
|
|
|
|
func f() {}
|
|
}
|