mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SourceEntityWalker is generally ignoring implicit AST nodes but we missed ignoring implicit patterns. This had the effect of not ignoring implicit pattern matches to Optional.some() which resulted in cursor-info returning Optional.some instead of what is actually written in code.
15 lines
267 B
Swift
15 lines
267 B
Swift
protocol P1 {}
|
|
|
|
struct S1 : P1 {}
|
|
|
|
func test(_ o: P1?) {
|
|
switch o {
|
|
case let s as S1:
|
|
test(s)
|
|
}
|
|
}
|
|
|
|
// RUN: %sourcekitd-test -req=cursor -pos=7:17 %s -- %s | %FileCheck -check-prefix=CHECK1 %s
|
|
// CHECK1: source.lang.swift.ref.struct (3:8-3:10)
|
|
// CHECK1: S1
|