Skip to content

Commit 38de344

Browse files
authored
Merge pull request #17552 from huonw/sr8075
[test] Add constraint test for SR-8075.
2 parents e29c61e + be7702e commit 38de344

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/Constraints/generics.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,3 +578,17 @@ func rdar39616039() {
578578
var c = foo(default: 42.0, ["foo": Float(0)])
579579
c += 1 // ok
580580
}
581+
582+
// https://bugs.swift.org/browse/SR-8075
583+
584+
func sr8075() {
585+
struct UIFont {
586+
init(ofSize: Float) {}
587+
}
588+
589+
func switchOnCategory<T>(_ categoryToValue: [Int: T]) -> T {
590+
fatalError()
591+
}
592+
593+
let _: UIFont = .init(ofSize: switchOnCategory([0: 15.5, 1: 20.5]))
594+
}

0 commit comments

Comments
 (0)