Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test] Add test case for now-fixed rdar://problem/39805133
- Loading branch information
1 parent
a9315e9
commit 1fc57ad
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
test/multifile/Inputs/protocol-conformance-rdar39805133-other.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
protocol DefaultInit { init() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ {} |