File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
validation-test/Serialization Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,11 @@ PropertyWrapperBackingPropertyTypeRequest::evaluate(
622622 if (!type)
623623 return Type ();
624624
625+ // If the declaration came from a module file, there's no need to
626+ // compute the auxiliary variables.
627+ if (!var->getDeclContext ()->getParentSourceFile ())
628+ return type;
629+
625630 // Set the interface type of each synthesized declaration.
626631 auto auxiliaryVars = var->getPropertyWrapperAuxiliaryVariables ();
627632 auxiliaryVars.backingVar ->setInterfaceType (type);
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: %target-swift-frontend -emit-module-path %t/WrappedParameter.swiftmodule -emit-module-source-info-path %t/WrappedParameter.swiftsourceinfo -module-name WrappedParameter -enable-testing %s
3+ // RUN: %target-swift-frontend -merge-modules -emit-module %t/WrappedParameter.swiftmodule -module-name WrappedParameter -o %t/WrappedParameter.swiftmodule
4+
5+ // Make sure wrapped parameters don't crash in merge-modules when
6+ // they were compiled with -emit-module-source-info and -enable-testing.
7+
8+ @propertyWrapper
9+ struct ProjectionWrapper < Value> {
10+ var wrappedValue : Value
11+
12+ var projectedValue : Self { self }
13+
14+ public init ( projectedValue: Self ) {
15+ self = projectedValue
16+ }
17+ }
18+
19+ func test( @ProjectionWrapper value: Int ) { }
You can’t perform that action at this time.
0 commit comments