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 @@ -3428,7 +3428,9 @@ void PrintAST::visitAccessorDecl(AccessorDecl *decl) {
3428
3428
printAttributes (decl);
3429
3429
// Explicitly print 'mutating' and 'nonmutating' if needed.
3430
3430
printMutabilityModifiersIfNeeded (decl);
3431
-
3431
+ if (decl->isConsuming ()) {
3432
+ Printer.printKeyword (" __consuming" , Options, " " );
3433
+ }
3432
3434
switch (auto kind = decl->getAccessorKind ()) {
3433
3435
case AccessorKind::Get:
3434
3436
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