// RUN: %target-typecheck-verify-swift class C { var x = 0 } class D: C {} var c1 = C() c1.x = 1 var d1 = D() d1.x = 2 // Array var ca: Array = [c1] var da: Array = [d1] ca = da da = ca // expected-error{{cannot assign value of type 'Array' to type 'Array'}} // expected-note@-1 {{arguments to generic parameter 'Element' ('C' and 'D') are expected to be equal}} var caa = [ca] var daa = [da] caa = daa // Array slice type var cas: [C] = [c1] var das: [D] = [d1] cas = das das = cas // expected-error{{cannot assign value of type '[C]' to type '[D]'}} // expected-note@-1 {{arguments to generic parameter 'Element' ('C' and 'D') are expected to be equal}} // ArraySlice var cs = ca[0...0] var ds = da[0...0] cs = ds // expected-error{{cannot assign value of type 'ArraySlice' to type 'ArraySlice'}} // expected-note@-1 {{arguments to generic parameter 'Element' ('D' and 'C') are expected to be equal}} ds = cs // expected-error{{cannot assign value of type 'ArraySlice' to type 'ArraySlice'}} // expected-note@-1 {{arguments to generic parameter 'Element' ('C' and 'D') are expected to be equal}} // ContiguousArray var cna: ContiguousArray = [c1] var dna: ContiguousArray = [d1] cna = dna // expected-error{{cannot assign value of type 'ContiguousArray' to type 'ContiguousArray'}} // expected-note@-1 {{arguments to generic parameter 'Element' ('D' and 'C') are expected to be equal}} dna = cna // expected-error{{cannot assign value of type 'ContiguousArray' to type 'ContiguousArray'}} // expected-note@-1 {{arguments to generic parameter 'Element' ('C' and 'D') are expected to be equal}}