10.50 was once greater than any real macOS version, but now it compares
less than real released versions, which makes these tests depend on the
deployment target unnecessarily. Update these tests to use even larger
numbers to hopefully keep them independent a little longer.
Generated interfaces for Clang modules used to try printing normal
comments between decls extracted from the header text. That was because
doc-comment was not common in C/ObjC headers. But mainly because of
"import as member feature" Clang decls aren't printed in the order as
they appear in the header file, the logic determinig which comment
belongs to which decl was not working property. We've decided to remove
that feature and only print the proper doc-comments as it has been
getting common.
rdar://93731287
The Clang importer implicitly synthesizes @discardableResult for
nearly all imported functions. Printing this attribute in the
generated interface leads to a lot of noise. Mark it as implicit so we
don't print it.
Most of this is in updating the standard library, SDK overlays, and
piles of test cases to use the new names. No surprises here, although
this shows us some potential heuristic tweaks.
There is one substantive compiler change that needs to be factored out
involving synthesizing calls to copyWithZone()/copy(zone:). Aside from
that, there are four failing tests:
Swift :: ClangModules/objc_parse.swift
Swift :: Interpreter/SDK/Foundation_test.swift
Swift :: Interpreter/SDK/archiving_generic_swift_class.swift
Swift :: Interpreter/SDK/objc_currying.swift
due to two independent remaining compiler bugs:
* We're not getting partial ordering between NSCoder's
encode(AnyObject, forKey: String) and NSKeyedArchiver's version of
that method, and
* Dynamic lookup (into AnyObject) doesn't know how to find the new
names. We need the Swift name lookup tables enabled to address this.
When adding mirror declaration members to a class, if the protocol has an annotated
availability then apply that availability to the mirror declaration member unless the
protocol member already has its own availability.
rdar://problem/21825141
Swift SVN r30251
The importer conjures up "mirrored" member declarations for imported
Obj-C classes that conform to a protocol with members that aren't exposed
in public headers. This commit extends our existing inference of availability
for members of unannotated Obj-C protocols to cover mirrored declarations
as well. For these mirrored declarations, we additionally constrain the
inferred availability with the availability of the class itself.
Swift SVN r30244
Based on feedback from Jordan, update r30060 to synthesize availability
attributes on unannotated Obj-C protocols in the importer. This has a
user-visible effect: calls to protocol requirements with these synthesized
attributes will now cause an availability error if the requirement is not
available in the calling type refinement context.
Swift SVN r30096
Reapply r28734. Argyrios updated SourceKit dependencies on swift and clang libraries in
SourceKit r28765, so this should work now.
Change the AST printer to use the new short-form @available attribute syntax for
attributes with only introduction versions. So, for example, a declaration
annotated as:
@available(iOS, introduced=8.0) @available(OSX, introduced=10.10)
func foo()
will be printed as:
@available(iOS 8.0, OSX 10.10, *) func foo()
We won't include the attribute on the short form if it has a deprecated or
obsoleted version; nor if it has a message, a rename, or marks unconditional
unavailability.
This commit has a corresponding change to the SourceKit tests.
rdar://problem/20982322
Swift SVN r28768
Change the AST printer to use the new short-form @available attribute syntax for
attributes with only introduction versions. So, for example, a declaration
annotated as:
@available(iOS, introduced=8.0)
@available(OSX, introduced=10.10)
func foo()
will be printed as:
@available(iOS 8.0, OSX 10.10, *)
func foo()
We won't include the attribute on the short form if it has a deprecated or
obsoleted version; nor if it has a message, a rename, or marks unconditional
unavailability.
There is a corresponding change to the SourceKit tests.
rdar://problem/20982322
Swift SVN r28734
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.
This is a divergence from Objective-C.
Swift SVN r28484
Remove the suppression of deprecation and potential unavailability diagnostics in
synthesized functions. We still suppress some explicit unavailability diagnostics -- those
in synthesized functions in synthesized functions that are lexically contained in
declarations that are themselves annotated as unavailable. For these cases, the right
solution <rdar://problem/20491640> is to not synthesize the bodies of these functions in
the first place.
rdar://problem/20024980
Swift SVN r27203
This reverts commits r26369 & r26381.
After upstream clang changes, reverted r25843 which was compensating for a previous upstream clang change.
But keep test/IDE/complete_from_clang_framework.swift disabled for further investigation, because it
seems to have some duplications in a code-completion test.
rdar://20245658&20247922
Swift SVN r26430
This commit addresses Jordan's concerns about the tests in r24973. We now use
FOUNDATION-NEXT rather than FOUNDATION to ensure we aren't skipping over declarations.
Swift SVN r24989
Move the availability printing tests from IDE/print_clang_decls.swift to
IDE/print_clang_framework.swift (which is only run on OS X). This commit should unbreak
the iOS build bots, which I broke in r24973.
This commit does not address Jordan's concerns with the tests. I will do that in a latter
commit.
Swift SVN r24985
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK. The driver was defaulting to the
host OS. Thus, we could not run the tests when the standard library was
not built for OS X.
Swift SVN r24504
Doing so is safe even though we have mock SDK. The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).
This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.
This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple. I
fixed the tests where I noticed this issue.
rdar://problem/19125022
Swift SVN r23683
Previously we only printed submodules that were imported by the
top-level module, which worked in the common case of inferred submodules
of frameworks (e.g. Foundation.NSArray), but fell over when the
submodules were explicit (e.g. OpenGL.GL), or just not imported by the
top-level module.
Swift SVN r20855
This is all goodness, and eliminates a major source of implicit conversions.
One thing this regresses on though, is that we now reject "x == nil" where
x is an option type and the element of the optional is not Equtatable. If
this is important, there are ways to enable this, but directly testing it as
a logic value is more straight-forward.
This does not include support for pattern matching against nil, that will be
a follow on patch.
Swift SVN r18918
-Hide vars that have a private type.
-Hide functions that have a parameter with private type or a parameter name with leading underscore.
-Minor change in StringUTF16.swift to avoid printing "func generate() -> IndexingGenerator<_StringCore>".
rdar://17027294
Swift SVN r18623