Skip to content

Add a couple of regression tests #41575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions test/Generics/sr15792_2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// RUN: %target-swift-frontend -typecheck %s

// Reduced from Realm open source project: https://github.com/realm/realm-swift.git

internal protocol RealmCollectionImpl: RealmCollection where Index == Int, SubSequence == Slice<Self> {}

public protocol RealmCollection: RealmCollectionBase, Equatable {}

public protocol RealmCollectionBase: RandomAccessCollection, LazyCollectionProtocol, CustomStringConvertible, ThreadConfined where Element: RealmCollectionValue {
typealias ElementType = Element
}

public protocol RealmCollectionValue: Hashable, _HasPersistedType where PersistedType: RealmCollectionValue {}

public protocol _HasPersistedType: _ObjcBridgeable {
associatedtype PersistedType: _ObjcBridgeable
}

public protocol _ObjcBridgeable {}

public protocol ThreadConfined {}

public protocol PersistableEnum: _PersistableInsideOptional, RawRepresentable, CaseIterable, RealmEnum, _RealmCollectionValueInsideOptional, MinMaxType, Comparable where RawValue: Comparable {}

public protocol _PersistableInsideOptional: _Persistable where PersistedType: _PersistableInsideOptional {}

public protocol _Persistable: _RealmSchemaDiscoverable, _HasPersistedType where PersistedType: _Persistable, PersistedType.PersistedType.PersistedType == PersistedType.PersistedType {}

public protocol RealmEnum: RealmOptionalType, _RealmSchemaDiscoverable {}

public protocol _RealmCollectionValueInsideOptional: RealmCollectionValue where PersistedType: _RealmCollectionValueInsideOptional {}

public protocol MinMaxType {}

public protocol _RealmSchemaDiscoverable {}

public protocol RealmOptionalType: _ObjcBridgeable {}
10 changes: 10 additions & 0 deletions validation-test/compiler_crashers_2_fixed/sr14668.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %target-swift-frontend -emit-ir %s

class A { }
class B<T> : A { }
class C {
func bar(x : (A?) -> Void) { }
}
class D<T> : C {
override func bar(x : (B<T>?) -> Void) { }
}