mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
statements. The approach is fairly simple: generate constraints for both the destination and source expressions, then turn the destination type into a type containing only rvalues and convert the source expression to that type. Swift SVN r2925
22 lines
368 B
Swift
22 lines
368 B
Swift
// RUN: %swift -parse -verify -constraint-checker %s
|
|
|
|
var i : Int
|
|
var f : Float
|
|
func getIntFloat() -> (Int, Float)
|
|
var ift : (Int, Float)
|
|
var ovl : Int
|
|
var ovl : Float
|
|
|
|
var slice : Int[]
|
|
|
|
i = i
|
|
i = 1
|
|
(i, f) = getIntFloat()
|
|
(i, f) = ift
|
|
(i, f) = (i, f)
|
|
(ovl, ovl) = ift
|
|
(ovl, ovl) = (i, f)
|
|
slice[7] = i
|
|
|
|
slice[7] = f // expected-error{{assignment does not type-check}}
|