Commit Graph

26 Commits

Author SHA1 Message Date
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Chris Willmore
73d5077bae Add API notes for Foundation following internal Swift 3 naming audit. 2016-04-07 20:35:18 -07:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Doug Gregor
06c5e9cd5b Enable "omit needless words" by default.
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.
2015-12-11 14:46:50 -08:00
Arnold Schwaighofer
859fbc0162 More executable_test for the test directory
Swift SVN r29280
2015-06-03 23:28:51 +00:00
Joe Groff
32fb006386 Clang Importer: Enable OptionSetType import.
Update the tests to match.

Swift SVN r28906
2015-05-22 05:47:37 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Chris Lattner
31c01eab73 Change the meaning of "if let x = foo()" back to Xcode 6.4 semantics. The compiler
includes a number of QoI things to help people write the correct code.  I will commit
the testcase for it as the next patch.

The bulk of this patch is moving the stdlib, testsuite and validation testsuite to
the new syntax.  I moved a few uses of "as" patterns back to as? expressions in the 
stdlib as well.



Swift SVN r27959
2015-04-30 04:38:13 +00:00
Dmitri Hrybenko
ab408d4dc3 Update the compiler and SDK overlay for nullability and generics in Foundation
We have an SPI between the Swift compiler and Foundation based on the
SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH preprocessor macro that allows us to
request the new API.  rdar://20270080 tracks removing it.

Swift SVN r26475
2015-03-24 02:18:06 +00:00
Graham Batty
83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00
Chris Willmore
68dd563fbf <rdar://problem/18311362> TLF: Eliminate implicit bridging conversions
Require 'as' when converting from Objective-C type to native type (but
continue to allow implicit conversion from native to Objective-C). This
conversion constraint is called ExplicitConversion; all implicit
conversions are covered by the existing Conversion constraint. Update
standard library and tests to match.

Swift SVN r24496
2015-01-18 00:07:45 +00:00
Graham Batty
83f27a8af7 Revert "Mark tests that don't pass on linux as XFAIL."
This reverts commit 2711ca86de7bf6a7885ccea24219a48a590b1e95.

Swift SVN r23577
2014-11-24 17:42:13 +00:00
Graham Batty
198402dcfe Mark tests that don't pass on linux as XFAIL.
Swift SVN r23573
2014-11-24 17:40:37 +00:00
Doug Gregor
3df2c11c8a Diagnose Objective-C method overrides not reflected as Swift overrides.
Diagnose cases where the use of @objc will produce Objective-C methods
that end up overriding an Objective-C method in a superclass, when
that override is not properly represented as an override in the Swift
type system. This can happen when the Objective-C methods are produced
by different kinds of entities. For example:

  class Super {
    @objc var property: Int
  }

  class Sub : Super {
    @objc func setProperty(property: Int) { }
  }

In Swift, Sub.setProperty and Super.property are completely
unrelated. However, both produce an Objective-C instance method with
the selector "setProperty:", so we end up with unexpected overriding
behavior. Diagnose this whenever it occurs, regardless of the kind of
@objc entity that produced the Objective-C methods: initializers,
deinitializers, methods, properties, or subscripts.

Implements the rest of the intended functionality of
rdar://problem/18391046, with the caveat that there are two remaining
classes of bugs:
  1) Superclasses defined in a module (or imported from a Clang
  module) aren't handled properly yet; we might not see those methods.
  2) We won't properly detect all of these failures when the methods
  are scattered across different source files in the same module.

Swift SVN r23170
2014-11-08 00:55:45 +00:00
Doug Gregor
3ebf5cb3da Switch the string literal protocols over to initializer requirements.
Swift SVN r22076
2014-09-18 15:48:42 +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
Joe Pamer
1fec0afbd0 Disallow value-to-optional conversions between argument and parameter types when resolving overloads for operators applied to nil literal operands.
This is a targeted fix to address rdar://problem/16848110 ("Disallow non-optionals to be compared to nil") and its associated dupes.

Swift SVN r20716
2014-07-29 23:24:36 +00:00
Doug Gregor
64e73744bd Mark NSString's designated initializers.
Different SDKs have different beliefs on what NSString's designated
initializers are. Use API notes to smooth over the differences.


Swift SVN r20498
2014-07-24 17:16:36 +00:00
Doug Gregor
5fc8ac7fd1 Require the 'override' keyword for initializers that override designated initializers.
Swift SVN r20490
2014-07-24 15:38:33 +00:00
Doug Gregor
eee00ca58b Require 'required' keyword when overriding a required initializer.
Swift SVN r20489
2014-07-24 15:30:15 +00:00
Doug Gregor
070ee7713a Treat imported initializers from Objective-C protocols as 'required'.
Initializers for non-final classes will soon need to be 'required' to
conform to an initializer requirement in a protocol, so start
marking imported initializers from Objective-C protocols as
'required'. This is part of <rdar://problem/17408284> and
<rdar://problem/17415607>.

Swift SVN r20428
2014-07-23 22:16:35 +00:00
Doug Gregor
d5a9c2ab94 Only supersede initializers with other imported initializers when the types match.
This fixes a case where the Swift-variadic and C-varargs versions of
various initializers were superseding each other
<rdar://problem/16801456>.

It also uncovered some more cases where we weren't getting quite the
right semantics for factory-methods-as-initializers, which are also
fixed here.

Swift SVN r18010
2014-05-13 16:49:39 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Joe Groff
a7d1d7e252 Add SDK-dependent Interpreter tests.
In the lit.site.cfg, if a MODULES_SDK is available, add a '%sdk' substitution and enable REQUIRES: sdk tests. Add some tests under test/Interpreter/SDK to test some basic ObjC interop features.

Swift SVN r4243
2013-02-28 23:44:41 +00:00