Commit Graph

172 Commits

Author SHA1 Message Date
Michael Ilseman
22ddf81047 [CG Import as Member] Fix argument label swap 2016-05-12 11:59:36 -07:00
Michael Ilseman
633d968c90 [Import as Member] Remove broken swift_name for CGPDFPageGetBoxRect 2016-05-12 10:18:08 -07:00
Michael Ilseman
8c65ef209e [CoreGraphics Renaming] Overhaul CG apinotes
Adds many more API renamings to CoreGraphics.apinotes
2016-05-06 14:52:24 -07:00
Dave Abrahams
debde16e2c Merge set-api branch into swift-3-indexing-model 2016-04-26 15:56:42 -07:00
Michael Ilseman
ba431a9954 [Import as member] CoreGraphics: Import global vars onto classes
With support from 16baa6, we can now use correct inference bahavior,
which is to import global variables as members on classes.
2016-04-12 10:48:18 -07:00
practicalswift
637db8809b Merge pull request #2143 from practicalswift/osx
[gardening] "OSX" → "OS X"
2016-04-12 09:24:03 +02:00
practicalswift
befbebcd30 [gardening] "OSX" → "OS X" 2016-04-11 23:12:40 +02:00
Michael Ilseman
151a19d3b8 [Import as member] Fixes to apinotes and tests
Fixes and clarifies a few API notes, and adds some test cases showing
current SILGen issues.
2016-04-11 11:31:12 -07:00
practicalswift
7bfe5c48f0 [gardening] Fix recently introduced typo: "auxilary" → "auxiliary" 2016-04-09 12:19:05 +02:00
Ted Kremenek
8e91efb39d Revert "Revert "[Import as member] First draft of renaming CG APIs"" 2016-04-08 21:26:03 -07:00
Ted Kremenek
18504de7dd Revert "[Import as member] First draft of renaming CG APIs" 2016-04-08 21:00:00 -07:00
Michael Ilseman
dc34fd61af [Import as member] Need to keep pre-9.0 APIs available 2016-04-08 17:17:44 -07:00
Michael Ilseman
3a2fed44f5 [Import as member] First draft of renaming CG APIs
This includes several large manual renaming of CG APIs where we want
different results than what the inference system produces.
2016-04-08 15:27:59 -07:00
Michael Ilseman
8a31b4b9f3 [Import as member] Mark CG APIs as nonswift
Several CG APIs are meant to be imported as nonswift, so mark them so
in our API notes.
2016-04-08 15:27:59 -07:00
Chris Willmore
73d5077bae Add API notes for Foundation following internal Swift 3 naming audit. 2016-04-07 20:35:18 -07:00
Michael Ilseman
2b5b839686 [Import as member] Turn on CoreGraphics.
Introduces CoreGraphics.apinotes, in which we enable the
import-as-member inference system. Additionally, include some explicit
SwiftNames, for when inference doesn't produce the right result, and
to aid compatibility with the overlays.

Refactors many of the trivial overlays out, shrinking the
CoreGraphics.swift overlay by over half. Updates in-tree test
cases. The names we currently have will be highly in flux for a while,
and are likely to change frequently over the near term.

There are a few remaining known bugs that are worked around by
apinotes entries.
2016-04-06 11:03:18 -07:00
Chris Willmore
40103ce628 Add API notes for frameworks following internal audit of Swift 3 API. 2016-04-04 19:55:17 -07:00
Doug Gregor
0e40128d1a [Clang importer] Use Clang swift_bridge attribute for bridging.
When an Objective-C class type is annotated with the swift_bridge
value type, bridge it to the named type. Use API notes on Foundation
rather than special cases.

For Objective-C classes where bridging was baked into the Clang
importer (NSString, NSArray, NSDictionary, NSSet), add API notes to
put the appropriate swift_bridge attribute on these Objective-C
classes.

Note: requires Clang update.
2016-03-10 23:10:28 -08:00
Doug Gregor
c1cc39accc [Clang importer] Rely on Clang's mapping of API notes to attributes directly.
Rather than managing API notes directly in the Clang importer, tell
Clang where to find the API notes files and let it map them directly
to attributes. Then, use the existing attribute-mapping
mechanisms---with minor extensions for cases where Clang previously
didn't map some Swift-specific API notes---to get at that information.

There is a minor regression where we can no longer apply API notes to
declarations that don't have a specific Clang declaration. The
specific example (NSError's inherited init()) comes from
rdar://problem/21042412; we've regressed here, but the correct fix is
(and has always been) on the Objective-C side
(rdar://problem/19977891).

Finishes rdar://problem/24447420.
2016-02-18 16:48:02 -08:00
yyx290799684
b829926d95 Update README.md 2015-12-05 15:24:42 +08:00
Pascal Welsch
e8009daa31 converted ApiNotes Readme.txt to markdown
makes the apinotes Readme more readable on github
2015-12-03 18:20:55 +01:00
David Farler
4ac9c80809 Add back remaining files for building and testing in Open Source 2015-10-31 00:19:20 -07:00
Jordan Rose
ff7b6b74fe Foundation overlay: Add a generic NSCoder.decodeObjectOfClass(_:forKey:).
Like decodeTopLevelObjectOfClass(_:forKey:), this API works very nicely
as a generic method in Swift, and this one is actually the one we expect
to be commonly used. One thing to note here is that these methods are
stricter than their ObjC counterparts: they will do a forced checked cast
even when the unarchiver does not use "secure" coding.

This depends on the previous commit; without it, we do not actually
enforce type safety for these methods.

The API notes change is to make the non-generic version of this method
unavailable so that it does not participate in overload resolution.
Without this we prefer the non-generic method unless there's a contextual
type for the result. I've filed rdar://problem/22243198 to track taking
this out once Foundation has updated their headers.

rdar://problem/17060110 (again)

Swift SVN r31154
2015-08-12 01:36:08 +00:00
Ben Langmuir
0fa6d7b65f Revert "Move GameKit overlay to GameCenter."
The headers went back to GameKit in a new SDK.

This reverts commit r30322.

Swift SVN r31015
2015-08-04 22:27:47 +00:00
Jordan Rose
965285f13d Move GameKit overlay to GameCenter.
In iOS 9 and OS X 10.11 the old GameKit was effectively renamed GameCenter, while
the new GameKit is a sort of umbrella framework like Cocoa. We need to support
backwards deployment, though, so the GameCenter overlay links to GameKit.framework.
(This is essentially the same solution implemented for CoreImage moving out of
QuartzCore in r28449)

rdar://problem/21340738

Swift SVN r30322
2015-07-17 19:54:38 +00:00
Jordan Rose
5619b5dd44 [apinotes] Remove information that has been migrated into the SDKs.
I'll be filing Radars for the rest of these. (Some of them already have them.)

rdar://problem/19003559&19756368&20276854

Swift SVN r29324
2015-06-05 23:02:17 +00:00
Jordan Rose
fa5bd4c6c8 [ClangImporter] Allow apinotes to affect inherited initializers.
Then use that to ban NSError.init(), because it doesn't create a valid
NSError. In the long run Foundation will hopefully add this to their
headers, but they can't yet (rdar://problem/19977891).

rdar://problem/21042412

Swift SVN r28881
2015-05-21 18:11:17 +00:00
Anna Zaks
57cac6a9fd [apinotes] Mark UIView's motionEffects as optional for backward compatibility.
Swift SVN r25016
2015-02-05 21:11:50 +00:00
Anna Zaks
8e8425a3ce [apinotes] Update nullability info for WatchKit
Swift SVN r24963
2015-02-04 18:15:57 +00:00
Argyrios Kyrtzidis
dfe9a2de57 [apinotes] Change to nullable parameter for NSZoneName.
Documentation for NSZoneName says:
"If zone is nil, the default zone is used".

Swift SVN r24731
2015-01-26 19:44:04 +00:00
Anna Zaks
7af94af837 [API Notes] Fix inconsistency between NSURLCredential's init and the factory method.
Swift SVN r24632
2015-01-22 03:48:46 +00:00
Anna Zaks
c2a7613612 [API Notes] Address outstanding nullability issues + new audited pieces
<rdar://problem/17902944> UIView's motionEffects property should never return 'nil'
<rdar://problem/17971360> [factor-init] SKPhysicsJointPin's factory method is not converted to a Swift API initializer
<rdar://problem/18553910> #IUO UICollectionViewUpdateItem properties
<rdar://problem/18875692> NSEntityDescription subentities/subentitiesByName should be marked optional
<rdar://problem/18919879> Swift: NSTableView's preparedCellAtColumn(_:row:) should return an optional
<rdar://problem/18940072> NSPredicate's init(format:) should not be optional
<rdar://problem/18987481> NSURLRequest without NSURL crashes Swift
<rdar://problem/19034448> UIPrintInfo’s -init is banned, should use +printInfo
<rdar://problem/19147412> NSUserInterfaceItemIdentification declares identifier as a non-optional String and it should be optional or IUO
<rdar://problem/19347931> Declaration of a parameter in Cocoa API in Swift is wrong (NSDateFormatter)
+ additions to the WatchKit audit

+ additions to HealthKit and HomeKit.

Swift SVN r24630
2015-01-22 03:29:07 +00:00
Greg Parker
bf88270ff8 Remove literal tab characters from an apinotes file.
Swift SVN r24565
2015-01-20 21:06:55 +00:00
Jordan Rose
09fb741f17 Prevent +[UIPrintInfo printInfo] from being imported as an initializer.
...because -[UIPrintInfo init] throws an exception saying not to call it
directly.

rdar://problem/19034448

Swift SVN r24561
2015-01-20 20:41:58 +00:00
Anna Zaks
474eeb2aef [apinotes] Audit WKInterfaceController's awakeWithContext.
See radar://19129934

Swift SVN r23710
2014-12-05 01:02:06 +00:00
Anna Zaks
9064df226a [apinotes] Add fresh API audit drop.
Here, we mark the null_resettable properties as explicit "U".
Fixed UIColor and NSColor's initWithCGColor as returning an optional (radar://18420272)
Fixed fontDescriptorWithSymbolicTraits (rdar://problem/18812268)
Contains audit for NSXMLParserDelegate (rdar://problem/18227344)
+ a few other newly audited APIs

Swift SVN r23698
2014-12-05 00:16:08 +00:00
Anna Zaks
ed9a765d43 [API Notes] Commit the WatchKit audit.
Swift SVN r23252
2014-11-11 23:29:43 +00:00
Anna Zaks
9c8f0df56d [API Notes] Mark window in supportedInterfaceOrientationsForWindow as optional.
Swift SVN r23160
2014-11-07 18:45:16 +00:00
Anna Zaks
e7e455a74a [API Notes] Fix several mis-audits.
See radar://18903832

Swift SVN r23155
2014-11-07 02:53:00 +00:00
Anna Zaks
4bd1dbd6bd API Notes: correct more mis-audits
radar://18240916 (NSFetchedResultsSectionInfo : name)
  radar://18495314 (UITableViewController  initWithStyle)
  radar://18406277 (UIViewController transitionFromViewController:toViewController:duration:options:animations:completion:)
  radar://18480210 (UITableViewCell textLabel, UITableViewCell imageView)
  radar://18481291 (NSManagedObjectModel mergedModelFromBundles:forStoreMetadata:)
  radar://18508088 (UICollectionView indexPathsForSelectedItems)
  radar://18447872 (NSDocumentController closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:
                    NSDocument
                       autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:
                       duplicateDocumentWithDelegate:didDuplicateSelector:contextInfo:
                    NSViewController
                       commitEditingWithDelegate:didCommitSelector:contextInfo:)
   UIViewController
     segueForUnwindingToViewController:fromViewController:identifier:

Swift SVN r22633
2014-10-09 20:23:26 +00:00
Anna Zaks
27116c7aad API Notes: Correct audit errors
- Mark more initializers as non-optional.
    <rdar://problem/18559511> Audit the list of UIKit symbols that marked as returning optional
    <rdar://problem/18559660> Audit the list of AppKit symbols that marked as returning optional
    <rdar://problem/18559676> Audit the list of Foundation symbols that marked as returning optional
    <rdar://problem/18559730> Audit the list of Scenekit symbols that marked as returning optional
 - NSMenu.popUpMenuPositioningItem (radar://18505688)
 - Remove NSXMLParserDelegate audit since it leads to crashes (radar://18227344)
 - UICollectionViewController collectionView should not be optional (radar://18508177)

Swift SVN r22570
2014-10-07 21:24:16 +00:00
Anna Zaks
1952296547 API Notes: Add WebKit audit
Swift SVN r22569
2014-10-07 21:24:11 +00:00
Anna Zaks
505257ae9b API Notes: This contains audit for most of AppKit!
Plus, smaller enhancements on the other frameworks.
Removes the need for _PrintableNSObjectType hack (rdar://problem/16883288)

Swift SVN r22185
2014-09-22 21:47:22 +00:00
Anna Zaks
9e5003e668 API Notes: Mark dispatch_retain and dispatch_release as unavailable.
Swift SVN r22091
2014-09-18 18:51:52 +00:00
Anna Zaks
c61280cf35 API Notes: Mark several APIs as unavailable.
- Make NSZone functions unavailable radar://16688847
 - Distributed Objects subsystem should not be imported into Swift radar://16689104
 - NSCalendarDate is available in Swift, but deprecated radar://16689207
 - Do not import NSMethodSignature class and related methods radar://16689329
 - NSInvocationOperation should be unavailble in Swift radar://17921785

Swift SVN r22090
2014-09-18 18:51:51 +00:00
Anna Zaks
61df57ea77 API Notes: Corrections to Foundation and UIKit
Swift SVN r21795
2014-09-09 01:47:04 +00:00
Doug Gregor
37db85ae8f -[NSData initWithBase64EncodedString:options:] can return nil
Swift SVN r21727
2014-09-04 23:06:57 +00:00
Doug Gregor
eaefb5e2b0 String's NSString API: Replace factory methods with failable initializers.
Addresses rdar://problem/18225788.


Swift SVN r21710
2014-09-04 17:21:33 +00:00
Doug Gregor
cc31f9bae0 Temporarily fix nullability of -[NSData initWithBase64EncodedString:options].
This keeps our own test cases running; the actual fix is tracked by
rdar://problem/18230185.


Swift SVN r21708
2014-09-04 16:10:41 +00:00
Anna Zaks
3997db5349 API Notes: Commit API Notes v13 (with copyWithZone returning N)
This drop adds 3 new frameworks: Metal, SceneKit, and SpriteKit.
The other frameworks (Foundation, CoreData, ObjectiveC, UIKit) have been refined:
 - conflicting items went to unknowns,
 - bugs got fixed,
 - more auditing has been performed.

Swift SVN r21443
2014-08-25 20:31:21 +00:00