File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -3433,7 +3433,9 @@ void PrintAST::visitAccessorDecl(AccessorDecl *decl) {
3433
3433
printAttributes (decl);
3434
3434
// Explicitly print 'mutating' and 'nonmutating' if needed.
3435
3435
printMutabilityModifiersIfNeeded (decl);
3436
-
3436
+ if (decl->isConsuming ()) {
3437
+ Printer.printKeyword (" __consuming" , Options, " " );
3438
+ }
3437
3439
switch (auto kind = decl->getAccessorKind ()) {
3438
3440
case AccessorKind::Get:
3439
3441
case AccessorKind::Address:
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %empty-directory(%t/missing)
3
+ // RUN: %empty-directory(%t/inputs)
4
+ // RUN: %target-swift-frontend -emit-module-path %t/missing/Foo.swiftmodule -enable-library-evolution -emit-module-interface-path %t/inputs/Foo.swiftinterface -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name Foo %s
5
+ // RUN: %FileCheck --input-file %t/inputs/Foo.swiftinterface %s
6
+
7
+ // RUN: touch %t/Bar.swift
8
+ // RUN: echo "import Foo" > %t/Bar.swift
9
+ // RUN: echo "let f = Field()" >> %t/Bar.swift
10
+
11
+ // RUN: %target-swift-frontend -emit-module-path %t/Bar.swiftmodule -enable-library-evolution -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name Bar %t/Bar.swift -I %t/inputs
12
+
13
+
14
+ import Swift
15
+
16
+ public struct Field {
17
+ public init ( ) { }
18
+ public var area : Int {
19
+ __consuming get { return 1 }
20
+ _modify {
21
+ var a = 1
22
+ yield & a
23
+ }
24
+ }
25
+ }
26
+
27
+ // CHECK: __consuming get
You can’t perform that action at this time.
0 commit comments