Skip to content

[NFC] Add some notes to getASTType()'s docstring. #27236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions include/swift/SIL/SILType.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,19 @@ class SILType {
}

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