File tree Expand file tree Collapse file tree 4 files changed +33
-9
lines changed Expand file tree Collapse file tree 4 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -525,13 +525,8 @@ class TypeRefinementContextBuilder : private ASTWalker {
525
525
// get expanded from macros attached to the parent declaration. We must
526
526
// not eagerly expand the attached property wrappers to avoid request
527
527
// cycles.
528
- if (auto *pattern = dyn_cast<PatternBindingDecl>(D)) {
529
- if (auto firstVar = pattern->getAnchoringVarDecl (0 )) {
530
- // FIXME: We could narrow this further by detecting whether there are
531
- // any macro expansions required to visit the CustomAttrs of the var.
532
- if (firstVar->hasInitialValue () && !firstVar->isInitExposedToClients ())
533
- return true ;
534
- }
528
+ if (isa<PatternBindingDecl>(D)) {
529
+ return true ;
535
530
}
536
531
537
532
return false ;
Original file line number Diff line number Diff line change 16
16
// CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=someStaticPropertyInferredType
17
17
// CHECK-NEXT: {{^}} (decl_implicit versions=[10.51,+Inf) decl=multiPatternStaticPropertyA
18
18
// CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=multiPatternStaticPropertyA
19
- // CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=someComputedProperty
19
+ // CHECK-NEXT: {{^}} (decl_implicit versions=[10.51,+Inf) decl=someComputedProperty
20
+ // CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=someComputedProperty
20
21
// CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=someOtherMethod()
21
22
@available ( OSX 10 . 51 , * )
22
23
class SomeClass {
@@ -61,7 +62,8 @@ func someFunction() { }
61
62
62
63
// CHECK-NEXT: {{^}} (decl versions=[10.51,+Inf) decl=SomeProtocol
63
64
// CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=protoMethod()
64
- // CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=protoProperty
65
+ // CHECK-NEXT: {{^}} (decl_implicit versions=[10.51,+Inf) decl=protoProperty
66
+ // CHECK-NEXT: {{^}} (decl versions=[10.52,+Inf) decl=protoProperty
65
67
@available ( OSX 10 . 51 , * )
66
68
protocol SomeProtocol {
67
69
@available ( OSX 10 . 52 , * )
@@ -233,6 +235,8 @@ extension SomeClass {
233
235
} ( )
234
236
}
235
237
238
+ // CHECK-NEXT: {{^}} (decl_implicit versions=[10.13,+Inf) decl=wrappedValue
239
+
236
240
@propertyWrapper
237
241
struct Wrapper < T> {
238
242
var wrappedValue : T
Original file line number Diff line number Diff line change
1
+ import Foundation
2
+ import Observation
3
+
4
+ @available ( SwiftStdlib 5 . 9 , * )
5
+ @Observable final public class AnotherObservableClass {
6
+ public var name : String
7
+
8
+ init ( name: String ) {
9
+ self . name = name
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ // REQUIRES: swift_swift_parser
2
+
3
+ // RUN: %target-swift-frontend -typecheck -parse-as-library -external-plugin-path %swift-plugin-dir#%swift-plugin-server -primary-file %s %S/Inputs/ObservableClass2.swift
4
+
5
+ // RUN: %target-swift-frontend -typecheck -parse-as-library -external-plugin-path %swift-plugin-dir#%swift-plugin-server %s -primary-file %S/Inputs/ObservableClass2.swift
6
+
7
+ // REQUIRES: observation
8
+ // REQUIRES: concurrency
9
+ // REQUIRES: objc_interop
10
+ // UNSUPPORTED: use_os_stdlib
11
+ // UNSUPPORTED: back_deployment_runtime
12
+
13
+ @available ( SwiftStdlib 5 . 9 , * )
14
+ let x = AnotherObservableClass ( name: " Hello " )
You can’t perform that action at this time.
0 commit comments