SILGen: Fix linkage for stored property initializers of private properties

Always give stored property initializers the linkage of the type
that contains them, even if the property is less visible than the
type.

This fixes the case where a type defines a private property, and an
extension in a different file from the same module defines a
constructor.

Fixes <rdar://problem/32743703>.
This commit is contained in:
Slava Pestov
2017-06-28 00:01:51 -04:00
parent d44cdf465a
commit e03e77d5a1
3 changed files with 47 additions and 0 deletions

View File

@@ -2,3 +2,11 @@ struct HasInitValue {
var x = 10
var y: String = ""
}
struct HasPrivateInitValue {
private var x = 10
}
public struct PublicStructHasInitValue {
var x = 10
}