Commit Graph

4 Commits

Author SHA1 Message Date
Kavon Farvardin
3dda59fea7 Sema: improve function cast checking
Functions can in fact conform to some protocols, notably,
marker protocols. Dynamically they have no influence on whether the cast
will succeed or not, as there is no way to tell if a type conforms to
such a protocol at runtime. But we should check them statically because
they otherwise can be cast to Any eventually.
2024-02-07 14:54:37 -08:00
Arnold Schwaighofer
e4e162d25f IRGen: Fix cast of existential type with anyobject to super class constraint existential
rdar://55987397
SR-11565
2019-10-11 10:00:14 -07:00
Michael Gottesman
de021aa32b [cast-opt] Eliminate a leak along the cast failure path when bridging from a swift to ns object derived class.
I added an interpreter test that exercises this code path using LifetimeTracked
to make sure we do not regress again.

rdar://49882071
2019-04-13 20:10:24 -07:00
Arnold Schwaighofer
0f8548153f IRGen: Add nil checks to scalarCheckedCasts
We claim to handle optional input types but not all paths of this function actually do.

rdar://39195672
2018-04-05 13:04:27 -07:00