mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The patch introduces a new setting instead of changing existing settings because the generated interfaces in the IDE have slightly different requirements; the extended type there is unconditionally not printed qualified (even if it is ambiguous). This is likely because the ambiguity heuristic is very weak; it doesn't even do name lookup. Simplifying that logic would be nice, but then we'd need to update a bunch of IDE/print* tests and end up with more more visual clutter in the IDE. Introducing the new setting means we can change the behavior for swiftinterface files without affecting the behavior for IDE interfaces. Fixes rdar://79093752.
60 lines
2.3 KiB
Swift
60 lines
2.3 KiB
Swift
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -disable-objc-attr-requires-foundation-module -enable-objc-interop > %t.swiftinterface
|
|
// RUN: %FileCheck %s < %t.swiftinterface
|
|
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t.swiftinterface
|
|
|
|
// CHECK-LABEL: public enum HasRawValue : Swift.Int {
|
|
public enum HasRawValue: Int {
|
|
// CHECK-NEXT: case a, b, c
|
|
case a, b = 5, c
|
|
// CHECK-DAG: public typealias RawValue = Swift.Int
|
|
// CHECK-DAG: @inlinable public init?(rawValue: Swift.Int)
|
|
// CHECK-DAG: public var rawValue: Swift.Int {
|
|
// CHECK-DAG: @inlinable get{{$}}
|
|
// CHECK-DAG: }
|
|
} // CHECK: {{^}$}}
|
|
|
|
@objc public enum ObjCEnum: Int32 {
|
|
case a, b = 5, c
|
|
}
|
|
|
|
// CHECK-LABEL: @objc public enum ObjCEnum : Swift.Int32 {
|
|
// CHECK-NEXT: case a, b = 5, c
|
|
// CHECK-DAG: public typealias RawValue = Swift.Int32
|
|
// CHECK-DAG: @inlinable public init?(rawValue: Swift.Int32)
|
|
// CHECK-DAG: public var rawValue: Swift.Int32 {
|
|
// CHECK-DAG: @inlinable get{{$}}
|
|
// CHECK-DAG: }
|
|
// CHECK: {{^}$}}
|
|
|
|
// CHECK-LABEL: public enum NoRawValueWithExplicitEquatable : Swift.Equatable {
|
|
public enum NoRawValueWithExplicitEquatable : Equatable {
|
|
// CHECK-NEXT: case a, b, c
|
|
case a, b, c
|
|
} // CHECK: {{^}$}}
|
|
|
|
// CHECK-LABEL: public enum NoRawValueWithExplicitHashable {
|
|
public enum NoRawValueWithExplicitHashable {
|
|
// CHECK-NEXT: case a, b, c
|
|
case a, b, c
|
|
} // CHECK: {{^}$}}
|
|
|
|
// CHECK-LABEL: extension synthesized.NoRawValueWithExplicitHashable : Swift.Hashable {
|
|
extension NoRawValueWithExplicitHashable : Hashable {
|
|
// CHECK-NEXT: public func foo()
|
|
public func foo() {}
|
|
} // CHECK: {{^}$}}
|
|
|
|
// CHECK: extension synthesized.HasRawValue : Swift.Equatable {}
|
|
// CHECK: extension synthesized.HasRawValue : Swift.Hashable {}
|
|
// CHECK: extension synthesized.HasRawValue : Swift.RawRepresentable {}
|
|
|
|
// CHECK: extension synthesized.ObjCEnum : Swift.Equatable {}
|
|
// CHECK: extension synthesized.ObjCEnum : Swift.Hashable {}
|
|
// CHECK: extension synthesized.ObjCEnum : Swift.RawRepresentable {}
|
|
|
|
// CHECK: extension synthesized.NoRawValueWithExplicitEquatable : Swift.Hashable {}
|
|
// NEGATIVE-NOT: extension {{.+}}NoRawValueWithExplicitEquatable : Swift.Equatable
|
|
|
|
// NEGATIVE-NOT: NoRawValueWithExplicitHashable : Swift.Equatable
|
|
// NEGATIVE-NOT: NoRawValueWithExplicitHashable : Swift.Hashable {}
|