[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:
gregomni
2016-01-13 15:05:26 -08:00
parent e711d5e427
commit 2b2e9dc80e
73 changed files with 468 additions and 414 deletions

View File

@@ -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: