Files
swift-mirror/test/Sema/struct_equatable_hashable_access.swift
Jordan Rose 28a1dc7770 Use 'fileprivate' for synthesized members of 'private' decls (#15980)
Since 'private' means "limit to the enclosing scope (and extensions
thereof)", putting it on a member means that the member can't be
accessed everywhere the type might show up. That's normally a good
thing, but it's not the desired effect for synthesized members used
for derived conformances, and when it comes to class initializers this
actually violates AST invariants.

rdar://problem/39478298
2018-04-17 15:19:35 -07:00

11 lines
419 B
Swift

// RUN: %target-swift-frontend -print-ast %s 2>&1 | %FileCheck %s
// Check that synthesized members show up as 'fileprivate', not 'private.
// CHECK-LABEL: private struct PrivateConformer : Hashable {
private struct PrivateConformer: Hashable {
var value: Int
// CHECK-DAG: fileprivate var hashValue: Int { get }
// CHECK-DAG: @_implements(Equatable, ==(_:_:)) fileprivate static func __derived_struct_equals
}