Add test case for https://github.com/apple/swift/issues/56636 / rdar://problem/74794074

This commit is contained in:
Slava Pestov
2023-04-28 18:01:29 -04:00
parent 2ad15893eb
commit c11371b8ca
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
@import Foundation;
typedef NS_ENUM( uint32_t, Letter ) {
a,
b,
};

View File

@@ -0,0 +1,13 @@
// RUN: %target-typecheck-verify-swift -import-objc-header %S/Inputs/issue-56636.h
// REQUIRES: objc_interop
extension Letter: Strideable {
public func distance(to other: Self) -> RawValue.Stride {
self.rawValue.distance( to: other.rawValue )
}
public func advanced(by n: RawValue.Stride) -> Self {
Self( rawValue: self.rawValue.advanced( by: n ) )!
}
}