mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CursorInfo] Fix bug when performing solver-based cursor info on Self
This commit is contained in:
@@ -81,6 +81,11 @@ const std::function<bool(const ExtensionDecl *)>
|
||||
void PrintOptions::setBaseType(Type T) {
|
||||
if (T->is<ErrorType>())
|
||||
return;
|
||||
if (auto DynamicSelf = T->getAs<DynamicSelfType>()) {
|
||||
// TypeTransformContext requires `T` to have members. Look through dynamic
|
||||
// Self.
|
||||
T = DynamicSelf->getSelfType();
|
||||
}
|
||||
TransformContext = TypeTransformContext(T);
|
||||
}
|
||||
|
||||
|
||||
7
test/SourceKit/CursorInfo/dynamic_self.swift
Normal file
7
test/SourceKit/CursorInfo/dynamic_self.swift
Normal file
@@ -0,0 +1,7 @@
|
||||
class UserCollection {
|
||||
static let staticMember = "ABC"
|
||||
func test() {
|
||||
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 1):10 %s -- %s
|
||||
Self.staticMember
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user