mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
An expression of DynamicLookup type can be unconditionally downcast to any class type via the postfix '!'. This will allow one to replace var w : NSWindow = (nsarray[0] as NSWindow)! with var w : NSWindow = nsarray[0]! The current implementation is fairly limited: it only works when the operand of '!' is an rvalue of type DynamicLookup, and we don't ensure that the result is a class type. Nonetheless, it cleans up some of ListMaker nicely. This is the first client of disjunction constraints, which were added in r9142. Swift SVN r9151