mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[tests] Adjusting SR-12869 test cases for optional mismatches
This commit is contained in:
@@ -3367,8 +3367,7 @@ bool ConstraintSystem::repairFailures(
|
||||
conversionsOrFixes.push_back(
|
||||
IgnoreAssignmentDestinationType::create(*this, lhs, rhs, loc));
|
||||
} else {
|
||||
conversionsOrFixes.push_back(
|
||||
TreatRValueAsLValue::create(*this, loc));
|
||||
conversionsOrFixes.push_back(TreatRValueAsLValue::create(*this, loc));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -323,8 +323,15 @@ let _ = dupLabelSubscriptStruct[foo: 5, foo: 5] // ok
|
||||
|
||||
var dict: [String: (Int, Int)] = [:]
|
||||
let bignum: Int64 = 1337
|
||||
dict["test"] = (bignum, 1) // expected-error {{cannot assign value of type '(Int64, Int)' to type '(Int, Int)'}}
|
||||
// expected-error@-1 {{cannot assign value of type '(Int64, Int)' to subscript of type '(Int, Int)'}}
|
||||
dict["test"] = (bignum, 1) // expected-error {{cannot assign value of type '(Int64, Int)' to subscript of type '(Int, Int)'}}
|
||||
|
||||
var tuple: (Int, Int)
|
||||
tuple = (bignum, 1) // expected-error {{cannot assign value of type '(Int64, Int)' to type '(Int, Int)'}}
|
||||
|
||||
var optionalTuple: (Int, Int)?
|
||||
var optionalTuple2: (Int64, Int)? = (bignum, 1)
|
||||
var optionalTuple3: (UInt64, Int)? = (bignum, 1) // expected-error {{cannot convert value of type '(Int64, Int)' to specified type '(UInt64, Int)?'}}
|
||||
|
||||
optionalTuple = (bignum, 1) // expected-error {{cannot assign value of type '(Int64, Int)' to type '(Int, Int)'}}
|
||||
// Optional to Optional
|
||||
optionalTuple = optionalTuple2 // expected-error {{cannot assign value of type '(Int64, Int)?' to type '(Int, Int)?'}}
|
||||
|
||||
Reference in New Issue
Block a user