Skip to content

Commit 46823c0

Browse files
authored
Merge pull request #27236 from apple/vg-doc-siltype-getASTType
2 parents 12bf25e + a744607 commit 46823c0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/swift/SIL/SILType.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,19 @@ class SILType {
159159
}
160160

161161
/// Returns the canonical AST type referenced by this SIL type.
162+
///
163+
/// NOTE:
164+
/// 1. The returned AST type may not be a proper formal type.
165+
/// For example, it may contain a SILFunctionType instead of a
166+
/// FunctionType.
167+
/// 2. The returned type may not be the same as the original
168+
/// unlowered type that produced this SILType (even after
169+
/// canonicalization). If you need it, you must pass it separately.
170+
/// For example, `AnyObject.Type` may get lowered to
171+
/// `$@thick AnyObject.Type`, for which the AST type will be
172+
/// `@thick AnyObject.Type`.
173+
/// More generally, you cannot recover a formal type from
174+
/// a lowered type. See docs/SIL.rst for more details.
162175
CanType getASTType() const {
163176
return CanType(value.getPointer());
164177
}

0 commit comments

Comments
 (0)