mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Preserve type sugar for generic typealiases
Introduce a new Type node, BoundNameAliasType, which describes a reference to a typealias that requires substitutions to produce the underlying type. This new type node is used both for references to generic typealiases and for references to (non-generic) typealiases that occur within generic contexts, e.g., Array<Int>.Element. At present, the new type node is mainly useful in preserving type sugar for diagnostics purposes, as well as being reflected in other tools (indexing, code completion, etc.). The intent is to completely replace NameAliasType in the future.
This commit is contained in:
@@ -647,6 +647,14 @@ namespace decls_block {
|
||||
TypeIDField // canonical type (a fallback)
|
||||
>;
|
||||
|
||||
using BoundNameAliasTypeLayout = BCRecordLayout<
|
||||
BOUND_NAME_ALIAS_TYPE,
|
||||
DeclIDField, // typealias decl
|
||||
TypeIDField, // parent type
|
||||
TypeIDField // underlying type
|
||||
// trailing substitutions
|
||||
>;
|
||||
|
||||
using GenericTypeParamTypeLayout = BCRecordLayout<
|
||||
GENERIC_TYPE_PARAM_TYPE,
|
||||
DeclIDField, // generic type parameter decl or depth
|
||||
|
||||
Reference in New Issue
Block a user