Commit Graph

6 Commits

Author SHA1 Message Date
Robert Widmann
71bf312a25 Migrate the rest of the tests to %empty-directory 2017-06-04 11:08:39 -07:00
Slava Pestov
de323b5bef Sema: Update resolveType() for subclass existentials
If the -enable-experimental-subclass-existentials staging flag
is on, resolveType() now allows protocol compositions to contain
class types. It also diagnoses if a composition has more than one
superclass requirement.

Also, change diagnostics that talked about 'protocol composition'
to 'protocol-constrained type'.

Since such types can now contain a superclass constraint, it's not
correct to call them protocol composition.

"Protocol-constrained type" isn't quite accurate either because
'Any' has no protocols, and 'AnyObject' will have no protocols but
a general class constraint; but those are edge cases which won't
come up in these diagnostics.
2017-04-10 17:11:07 -07:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Jordan Rose
1fcd7d725d [test] Add '--param swift-version=3' to lit's configuration. (#5566)
This allows us to run our entire test suite (well, okay, just
invocations of swift/swiftc and swift-ide-test) under Swift 3 mode or
Swift 4 mode, which will be more important as the two modes diverge.
The default is Swift 3 mode for now, which matches the behavior before
this patch (because the master compiler still calls itself 3.0).

Individual tests can still use "-swift-version 3" to override the mode
set by lit, but if an entire test requires Swift 3 or Swift 4, there's
also a new test feature "SWIFT_VERSION=3" or "SWIFT_VERSION=4".
However, if you /do/ need to override or restrict the version, you
should also add a test for the "other" version as well, unless it's
part of the Compatibility suite or otherwise specifically testing
-swift-version-related functionality.
2016-11-02 14:01:48 -07:00
practicalswift
5f8ce30ec4 [gardening] Fix recently introduced typos. 2016-10-19 12:59:10 +02:00
Rintaro Ishizaki
c138e4cd8f [Sema] Swift3 compatibility: Fix ambiguous protocol composition production
Fixes: https://bugs.swift.org/browse/SR-2843

'P1 & P2.Type' is mistakingly accepted and parsed as (meatatype (composition P1, P2))
in swift3. Now, we parse it as (composition P1, (metatype P2))

For source compatibility, reconstruct it as Swift3.

Also, this solves inconsistent behavior between type and type-expression in Swift3.

typealias T1 = P1 & P2?  // was accepted as '(P1 & P2)?'
let T2 = (P1 & P2?).self // was silently accepted as 'P1' in Swift3.0
2016-10-19 02:22:23 +09:00