Skip to content

Commit d8855c8

Browse files
authored
Merge pull request #86061 from slavapestov/regression-tests-12-15-2025
Add more regression tests
2 parents f083c4b + e0a8c4f commit d8855c8

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
struct Foo : ExpressibleByUnicodeScalarLiteral {}
4+
let _: Foo = "\\"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
extension Dictionary {
4+
init<S: Sequence>(grouping elements: S, by keyForValue: (S.Iterator.Element) -> Key)
5+
where Value : RangeReplaceableCollection, Value.Iterator.Element == S.Iterator.Element {
6+
self = [:]
7+
}
8+
}
9+
10+
let names = ["Patti", "Aretha", "Anita", "Gladys"]
11+
print(Dictionary(grouping: names, by: { $0.utf16.count }))
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: not %target-swift-frontend -typecheck %s
2+
3+
struct _MyError: ExpressibleByIntegerLiteral {
4+
typealias IntegerLiteralType = Int
5+
6+
private var _underlyingValue: _MyError.IntegerLiteralType
7+
var httpErrorCode: UInt = 0
8+
9+
public init(integerLiteral value: _MyError.IntegerLiteralType) {
10+
_underlyingValue = value
11+
}
12+
}
13+
14+
enum MyError: _MyError, Error {
15+
typealias RawValue = Int
16+
case caseOne = 0
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
protocol Prot {
4+
var prop: String { get }
5+
}
6+
7+
class Gen<A: Prot> { }
8+
9+
class Real: Gen<Real.RealProt> {
10+
enum RealProt: Prot {
11+
case first
12+
13+
var prop: String {
14+
return "hello"
15+
}
16+
}
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
// REQUIRES: objc_interop
3+
4+
import Foundation
5+
6+
class C {
7+
@objc func foo() -> String! { return nil }
8+
}
9+
10+
func bar(_ x: AnyObject) {
11+
let y: String = x.foo!()
12+
}

0 commit comments

Comments
 (0)