mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SR-511][Parse] Add 'associatedtype' keyword and fixit
Adds an associatedtype keyword to the parser tokens, and accepts either typealias or associatedtype to create an AssociatedTypeDecl, warning that the former is deprecated. The ASTPrinter now emits associatedtype for AssociatedTypeDecls. Separated AssociatedType from TypeAlias as two different kinds of CodeCompletionDeclKinds. This part probably doesn’t turn out to be absolutely necessary currently, but it is nice cleanup from formerly specifically glomming the two together. And then many, many changes to tests. The actual new tests for the fixits is at the end of Generics/associated_types.swift.
This commit is contained in:
@@ -394,6 +394,7 @@ static bool matchesExpectedStyle(Completion *completion, NameStyle style) {
|
||||
case CodeCompletionDeclKind::Enum:
|
||||
case CodeCompletionDeclKind::Protocol:
|
||||
case CodeCompletionDeclKind::TypeAlias:
|
||||
case CodeCompletionDeclKind::AssociatedType:
|
||||
return style.possiblyUpperCamelCase();
|
||||
|
||||
case CodeCompletionDeclKind::StaticMethod:
|
||||
|
||||
Reference in New Issue
Block a user