Skip to content

[test] Add a test for the tricky circularity in SR-5191 #11685

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 1 commit into from
Aug 29, 2017
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
17 changes: 17 additions & 0 deletions validation-test/Serialization/Inputs/SR5191-other.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
protocol FooBaseProto {}

protocol FooProto: FooBaseProto {}

protocol BarProto {
associatedtype Foo: FooProto
init(foo: Foo)
}

protocol BazProto {
associatedtype Bar: BarProto
init(bar: Bar)
}

struct BarImpl: BarProto {
init(foo: FooImpl) {}
}
14 changes: 14 additions & 0 deletions validation-test/Serialization/SR5191.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -module-name SwiftCrash -emit-module -o %t/SR5191.swiftmodule %s %S/Inputs/SR5191-other.swift
// RUN: %target-build-swift -module-name SwiftCrash -emit-module -o %t/SR5191_reversed.swiftmodule %S/Inputs/SR5191-other.swift %s

// REQUIRES: objc_interop
// The module name is significant here; it must be later ASCIIbetically than
// "Swift". This has to do with the canonical ordering of protocols, including
// those inherited by extending NSObject.

import Foundation

class FooImpl: NSObject, FooProto, BazProto {
required init(bar: BarImpl) {}
}