Skip to content

[Test] Add test case for now-fixed rdar://problem/39805133 #19827

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
Oct 11, 2018
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
protocol DefaultInit { init() }
29 changes: 29 additions & 0 deletions test/multifile/protocol-conformance-rdar39805133.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// RUN: %target-swift-frontend -emit-ir -o - -primary-file %s %S/Inputs/protocol-conformance-rdar39805133-other.swift -module-name foo
// RUN: %target-swift-frontend -emit-ir -o - %s -primary-file %S/Inputs/protocol-conformance-rdar39805133-other.swift -module-name foo

protocol _Int : DefaultInit {
associatedtype Minus1 : _Int
associatedtype Plus1 : _Int = Inc<Self>
static var value: Int { get }
}

struct Inc<T : _Int> : _Int {
typealias Minus1 = T
static var value: Int { return T.value + 1 }
}

extension _Int {
var plus1: Plus1 { return Plus1() }
var minus1: Minus1 { return Minus1() }
}

struct _0_ : _Int {
typealias Minus1 = _0_//Underflow
static let value = 0
}

let _0 = _0_()
protocol AtLeast0 : _Int {}
extension _0_ : AtLeast0 {}
protocol AtLeast1 : AtLeast0 {}
extension Inc : AtLeast1, AtLeast0 where T == _0_ {}