mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Factor out Expr::getNameLoc
There are a bunch of AST nodes that can have associated DeclNameLocs, make sure we cover them all. I don't think this makes a difference for `unwrapPropertyWrapperParameterTypes` since the extra cases should be invalid, but for cursor info it ensures we handle UnresolvedMemberExprs.
This commit is contained in:
14
test/SourceKit/CursorInfo/issue-77981.swift
Normal file
14
test/SourceKit/CursorInfo/issue-77981.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
struct S {
|
||||
static func foo(_ x: Int) -> S {}
|
||||
static func foo(_ x: String) -> S {}
|
||||
}
|
||||
|
||||
// https://github.com/swiftlang/swift/issues/77981 - Make sure we can resolve
|
||||
// solver-based cursor info for UnresolvedMemberExprs.
|
||||
func bar() {
|
||||
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 1):15 %s -- %s | %FileCheck %s
|
||||
let _: S = .foo()
|
||||
}
|
||||
|
||||
// CHECK-DAG: source.lang.swift.ref.function.method.static (2:15-2:28)
|
||||
// CHECK-DAG: source.lang.swift.ref.function.method.static (3:15-3:31)
|
||||
Reference in New Issue
Block a user