Skip to content

Commit 7462169

Browse files
authored
Merge pull request #41575 from slavapestov/regression-test-sr14668-sr15792
Add a couple of regression tests
2 parents e16b126 + 05ded06 commit 7462169

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

test/Generics/sr15792_2.swift

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// RUN: %target-swift-frontend -typecheck %s
2+
3+
// Reduced from Realm open source project: https://github.com/realm/realm-swift.git
4+
5+
internal protocol RealmCollectionImpl: RealmCollection where Index == Int, SubSequence == Slice<Self> {}
6+
7+
public protocol RealmCollection: RealmCollectionBase, Equatable {}
8+
9+
public protocol RealmCollectionBase: RandomAccessCollection, LazyCollectionProtocol, CustomStringConvertible, ThreadConfined where Element: RealmCollectionValue {
10+
typealias ElementType = Element
11+
}
12+
13+
public protocol RealmCollectionValue: Hashable, _HasPersistedType where PersistedType: RealmCollectionValue {}
14+
15+
public protocol _HasPersistedType: _ObjcBridgeable {
16+
associatedtype PersistedType: _ObjcBridgeable
17+
}
18+
19+
public protocol _ObjcBridgeable {}
20+
21+
public protocol ThreadConfined {}
22+
23+
public protocol PersistableEnum: _PersistableInsideOptional, RawRepresentable, CaseIterable, RealmEnum, _RealmCollectionValueInsideOptional, MinMaxType, Comparable where RawValue: Comparable {}
24+
25+
public protocol _PersistableInsideOptional: _Persistable where PersistedType: _PersistableInsideOptional {}
26+
27+
public protocol _Persistable: _RealmSchemaDiscoverable, _HasPersistedType where PersistedType: _Persistable, PersistedType.PersistedType.PersistedType == PersistedType.PersistedType {}
28+
29+
public protocol RealmEnum: RealmOptionalType, _RealmSchemaDiscoverable {}
30+
31+
public protocol _RealmCollectionValueInsideOptional: RealmCollectionValue where PersistedType: _RealmCollectionValueInsideOptional {}
32+
33+
public protocol MinMaxType {}
34+
35+
public protocol _RealmSchemaDiscoverable {}
36+
37+
public protocol RealmOptionalType: _ObjcBridgeable {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
class A { }
4+
class B<T> : A { }
5+
class C {
6+
func bar(x : (A?) -> Void) { }
7+
}
8+
class D<T> : C {
9+
override func bar(x : (B<T>?) -> Void) { }
10+
}

0 commit comments

Comments
 (0)