Commit Graph

22 Commits

Author SHA1 Message Date
Robert Widmann
4f465224ea Polish off uses of dynamicType in tests 2016-07-29 16:59:14 -07:00
Joe Groff
cfdb957d60 Update Interpreter tests for id-as-Any. 2016-07-25 06:40:35 -07:00
John McCall
6328f3fe0b Explicitly represent "pseudo-generic" functions in SIL, which do
not have access to their type arguments at runtime.  Use this to
fix the emission of native thunks for imported ObjC-generic
initializers, since they may need to perform bridging.

For now, pseudo-genericity is all-or-nothing, but we may want to
make it apply only to certain type arguments.

Also, clean up some code that was using dead mangling nodes.
2016-06-01 11:41:27 -07:00
Ted Kremenek
d3c41c4668 Revert "Revert "SE-0072: Fully eliminate implicit bridging conversions from Swift"" (#2441) 2016-05-06 23:26:45 -07:00
Ted Kremenek
4df003c291 Revert "SE-0072: Fully eliminate implicit bridging conversions from Swift" (#2440) 2016-05-06 23:22:56 -07:00
Joe Pamer
3b4d98445e SE-0072: Fully eliminate implicit bridging conversions from Swift
Per Swift Evolution proposal SE-0072, these changes prevent the compiler from introducing implicit bridging conversions during type checking.
2016-05-05 19:36:33 -07:00
Joe Groff
c49a992598 Turn on import of ObjC generics. 2016-04-25 11:56:13 -07:00
Dmitri Gribenko
d307e310b3 Merge pull request #2101 from harlanhaskins/stdlibunittest-interpreter-skip-crashes
[StdlibUnittest] Allow Interpreter to Expect Crashes
2016-04-08 16:38:52 -07:00
Harlan Haskins
5d888873da [StdlibUnittest] Teach interpreter to run crash tests 2016-04-08 13:12:53 -07:00
Chris Willmore
73d5077bae Add API notes for Foundation following internal Swift 3 naming audit. 2016-04-07 20:35:18 -07:00
Joe Groff
9c5564f808 Allow subclasses of specific instantiations of ObjC generic classes.
If a subclass grounds all the type parameters from its base class, we don't have to worry about any erasure edge cases. We should be able to support this, giving existing code that subclasses the nongeneric form of the class a migration path. Spot-fix some places in IRGen where we assume we can't emit static references to ObjC generic classes or metaclasses.
2016-04-06 21:19:11 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Joe Groff
cbbe9f89ce IRGen: Pretend to satisfy generic parameters from the 'Self' parameter to extension methods.
We prevent the generic parameters to an ObjC generic from being used in an extension method at the sema level, and we don't want the polymorphic convention to try to generate independent parameters since that would break the method convention. Trick the polymorphic convention by producing "impossible" fulfillments for the generic parameters derivable from an ObjC generic method's self type.
2016-04-05 08:55:26 -07:00
Joe Groff
7433cc167c swift-3-ify interpreter test 2016-03-28 09:50:30 -07:00
Joe Groff
1d61e8c3cb Add tests for nongeneric ObjC methods inherited into generic ObjC class 2016-03-28 09:50:30 -07:00
Joe Groff
ecc943736f Optionals of ObjC generic class type are representable in ObjC. 2016-03-28 09:50:30 -07:00
Joe Groff
cde1951e62 Test an @objc method using imported ObjC generic types. 2016-03-28 09:50:30 -07:00
Joe Groff
92ed4f1a71 IRGen: Erase ObjC generics before forming metadata references.
The generic parameters to an ObjC class don't exist at runtime, so when forming a metadata reference, lower them away.
2016-03-28 09:50:30 -07:00
Chris Willmore
30e12c5938 Clarify failing IRGen test case. 2016-03-28 09:50:30 -07:00
Jordan Rose
b6f7ed64b1 [IRGen] Functions with the ObjCMethod convention are not polymorphic.
...even if the 'self' type is generic. Additionally, Objective-C generic
types cannot be used as a source of type metadata, because Objective-C
generics are erased at runtime by default. (This may need to change.)

With these two changes, we now pass type metadata explicitly when we need
to, and /don't/ try to pass it to Objective-C methods that would have
needed it if they were Swift methods.
2016-03-28 09:50:30 -07:00
Jordan Rose
d4d43d18e3 [test] Convert imported_objc_generics to StdlibUnittest.
...and clean up a few things, and fill out a few more tests.
2016-03-28 09:50:30 -07:00
Chris Willmore
3bcb169f0b Import lightweight Objective-C generics as Swift generic type
parameters.
2016-03-28 09:50:30 -07:00