Skip to content

Commit c7fdbdf

Browse files
[tests] Adding regression tests for SR-12869
1 parent f13b00f commit c7fdbdf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/Constraints/tuple.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,13 @@ struct DupLabelSubscript {
318318

319319
let dupLabelSubscriptStruct = DupLabelSubscript()
320320
let _ = dupLabelSubscriptStruct[foo: 5, foo: 5] // ok
321+
322+
// SR-12869
323+
324+
var dict: [String: (Int, Int)] = [:]
325+
let bignum: Int64 = 1337
326+
dict["test"] = (bignum, 1) // expected-error {{cannot assign value of type '(Int64, Int)' to type '(Int, Int)'}}
327+
// expected-error@-1 {{cannot assign value of type '(Int64, Int)' to subscript of type '(Int, Int)'}}
328+
329+
var tuple: (Int, Int)
330+
tuple = (bignum, 1) // expected-error {{cannot assign value of type '(Int64, Int)' to type '(Int, Int)'}}

0 commit comments

Comments
 (0)