"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/expr/cast/objc_coerce_array.swift" between
swift-swift-5.8-RELEASE.tar.gz and swift-swift-5.8.1-RELEASE.tar.gz

About: Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns (developed by Apple).

objc_coerce_array.swift  (swift-swift-5.8-RELEASE):objc_coerce_array.swift  (swift-swift-5.8.1-RELEASE)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-silgen -veri fy %s // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-silgen -veri fy %s
// REQUIRES: objc_interop // REQUIRES: objc_interop
import Foundation import Foundation
var x = 1 var x = 1
_ = [x] as [NSNumber] _ = [x] as [NSNumber]
_ = ["x":["y":"z","a":1]] as [String : [String : AnyObject]] _ = ["x":["y":"z","a":1]] as [String : [String : AnyObject]]
// expected-warning@-1{{heterogeneous collection literal could only be inferred to '[String : AnyObject]'; add explicit type annotation if this is intentiona}}
_ = ["x":["z",1]] as [String : [AnyObject]] _ = ["x":["z",1]] as [String : [AnyObject]]
// expected-warning@-1{{heterogeneous collection literal could only be inferred to '[AnyObject]'; add explicit type annotation if this is intentional}}
_ = [["y":"z","a":1]] as [[String : AnyObject]] _ = [["y":"z","a":1]] as [[String : AnyObject]]
// expected-warning@-1{{heterogeneous collection literal could only be inferred to '[String : AnyObject]'; add explicit type annotation if this is intentional}}
_ = [["z",1]] as [[AnyObject]] _ = [["z",1]] as [[AnyObject]]
// expected-warning@-1{{heterogeneous collection literal could only be inferred to '[AnyObject]'; add explicit type annotation if this is intentional}}
var y: Any = 1 var y: Any = 1
_ = ["x":["y":"z","a":y]] as [String : [String : AnyObject]] _ = ["x":["y":"z","a":y]] as [String : [String : AnyObject]]
_ = ["x":["z",y]] as [String : [AnyObject]] _ = ["x":["z",y]] as [String : [AnyObject]]
_ = [["y":"z","a":y]] as [[String : AnyObject]] _ = [["y":"z","a":y]] as [[String : AnyObject]]
_ = [["z",y]] as [[AnyObject]] _ = [["z",y]] as [[AnyObject]]
 End of changes. 4 change blocks. 
4 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)