Skip to content

Commit 3ea4b74

Browse files
committed
---
yaml --- r: 348130 b: refs/heads/master c: ecbcf48 h: refs/heads/master
1 parent 348c3cb commit 3ea4b74

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 740e327cfe2d94ecf00c9da066421e1d9318e38d
2+
refs/heads/master: ecbcf4815a1609c0b8c105bbb748213846e6e76c
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4244,7 +4244,7 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
42444244
void visitOpaqueTypeArchetypeType(OpaqueTypeArchetypeType *T) {
42454245
switch (Options.OpaqueReturnTypePrinting) {
42464246
case PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword:
4247-
Printer << "some ";
4247+
Printer.printKeyword("some", Options, /*Suffix=*/" ");
42484248
LLVM_FALLTHROUGH;
42494249
case PrintOptions::OpaqueReturnTypePrintingMode::WithoutOpaqueKeyword: {
42504250
visit(T->getExistentialType());

trunk/lib/AST/TypeRepr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ void ProtocolTypeRepr::printImpl(ASTPrinter &Printer,
555555

556556
void OpaqueReturnTypeRepr::printImpl(ASTPrinter &Printer,
557557
const PrintOptions &Opts) const {
558-
Printer << "some ";
558+
Printer.printKeyword("some", Opts, /*Suffix=*/" ");
559559
printTypeRepr(Constraint, Printer, Opts);
560560
}
561561

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class Base {}
2+
3+
public protocol Proto {}
4+
5+
public func foo() -> some Base & Proto {
6+
class Derived: Base, Proto {}
7+
return Derived()
8+
}
9+
10+
// RUN: %sourcekitd-test -req=cursor -pos=5:13 %s -- %s | %FileCheck %s
11+
// CHECK: <Declaration>public func foo() -&gt; some <Type usr=[[Base_USR:.*]]>Base</Type> &amp; <Type usr=[[Proto_USR:.*]]>Proto</Type></Declaration>
12+
// CHECK: <decl.function.free><syntaxtype.keyword>public</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>foo</decl.name>() -&gt; <decl.function.returntype><syntaxtype.keyword>some</syntaxtype.keyword> <ref.class usr=[[Base_USR]]>Base</ref.class> &amp; <ref.protocol usr=[[Proto_USR]]>Proto</ref.protocol></decl.function.returntype></decl.function.free>

0 commit comments

Comments
 (0)