mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Strict memory safety] Nested types are safe/unsafe independent of their enclosing type
When determining whether a nested type is safe, don't consider whether its enclosing type is safe. They're independent.
This commit is contained in:
@@ -277,6 +277,15 @@ struct UnsafeContainingUnspecified {
|
||||
typealias A = Int
|
||||
|
||||
func getA() -> A { 0 }
|
||||
|
||||
@safe
|
||||
struct Y {
|
||||
var value: Int
|
||||
}
|
||||
|
||||
func f() {
|
||||
_ = Y(value: 5)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user