Skip to content

Commit e9fd257

Browse files
committed
---
yaml --- r: 348990 b: refs/heads/master c: 9e89d56 h: refs/heads/master
1 parent 01f6b6b commit e9fd257

File tree

251 files changed

+3161
-4846
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+3161
-4846
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 12231d2df32c2960f44dc3cd6a0affafefc836be
2+
refs/heads/master: 9e89d56c57b4bdb63efc6dbc67942fcd63320f27
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

trunk/CHANGELOG.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,63 @@ Swift 5.2
5858
(foo as Magic)(5)
5959
```
6060

61+
* [SR-11298][]:
62+
63+
A class-constrained protocol extension, where the extended protocol does
64+
not impose a class constraint, will now infer the constraint implicitly.
65+
66+
```swift
67+
protocol Foo {}
68+
class Bar: Foo {
69+
var someProperty: Int = 0
70+
}
71+
72+
// Even though 'Foo' does not impose a class constraint, it is automatically
73+
// inferred due to the Self: Bar constraint.
74+
extension Foo where Self: Bar {
75+
var anotherProperty: Int {
76+
get { return someProperty }
77+
// As a result, the setter is now implicitly nonmutating, just like it would
78+
// be if 'Foo' had a class constraint.
79+
set { someProperty = newValue }
80+
}
81+
}
82+
```
83+
84+
As a result, this could lead to code that currently compiles today to throw an error.
85+
86+
```swift
87+
protocol Foo {
88+
var someProperty: Int { get set }
89+
}
90+
91+
class Bar: Foo {
92+
var someProperty = 0
93+
}
94+
95+
extension Foo where Self: Bar {
96+
var anotherProperty1: Int {
97+
get { return someProperty }
98+
// This will now error, because the protocol requirement
99+
// is implicitly mutating and the setter is implicitly
100+
// nonmutating.
101+
set { someProperty = newValue } // Error
102+
}
103+
}
104+
```
105+
106+
**Workaround**: Define a new mutable variable inside the setter that has a reference to `self`:
107+
108+
```swift
109+
var anotherProperty1: Int {
110+
get { return someProperty }
111+
set {
112+
var mutableSelf = self
113+
mutableSelf.someProperty = newValue // Okay
114+
}
115+
}
116+
```
117+
61118
* [SE-0253][]:
62119

63120
Values of types that declare `func callAsFunction` methods can be called
@@ -83,7 +140,7 @@ Swift 5.2
83140

84141
* [SR-4206][]:
85142

86-
A method override is no longer allowed to have a generic signature with
143+
A method override is no longer allowed to have a generic signature with
87144
requirements not imposed by the base method. For example:
88145

89146
```
@@ -7799,4 +7856,5 @@ Swift 1.0
77997856
[SR-8974]: <https://bugs.swift.org/browse/SR-8974>
78007857
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
78017858
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>
7859+
[SR-11298]: <https://bugs.swift.org/browse/SR-11298>
78027860
[SR-11429]: <https://bugs.swift.org/browse/SR-11429>

trunk/cmake/modules/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ set(SWIFT_LIBRARY_DIRS ${SWIFT_LIBRARY_OUTPUT_INTDIR})
1616
configure_file(
1717
SwiftConfig.cmake.in
1818
${swift_cmake_builddir}/SwiftConfig.cmake
19-
@ONLY)
19+
@ONLY)

trunk/cmake/modules/SwiftConfig.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set(SWIFT_VERSION @SWIFT_VERSION@)
66
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)
77

88
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
9-
set(SWIFT_LIBRARY_DIRS "@SWIFT_LIBRARY_DIRS@")
9+
set(SWIFT_LIBRARY_DIRS "@SWIFT_CONFIG_LIBRARY_DIRS@")
1010

1111
# These variables are duplicated, but they must match the LLVM variables of the
1212
# same name. The variables ending in "S" could some day become lists, and are
1313
# preserved for convention and compatibility.
1414
set(SWIFT_INCLUDE_DIR "@SWIFT_INCLUDE_DIRS@")
15-
set(SWIFT_LIBRARY_DIR "@SWIFT_LIBRARY_DIRS@")
15+
set(SWIFT_LIBRARY_DIR "@SWIFT_CONFIG_LIBRARY_DIRS@")
1616

1717
set(SWIFT_CMAKE_DIR "@SWIFT_CMAKE_DIR@")
1818
set(SWIFT_BINARY_DIR "@SWIFT_BINARY_DIR@")

trunk/cmake/modules/SwiftSource.cmake

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@ function(_compile_swift_files
310310
set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
311311
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
312312
set(specific_module_dir "${module_base}.swiftmodule")
313-
set(specific_module_project_dir "${specific_module_dir}/Project")
314-
set(source_info_file "${specific_module_project_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
313+
set(specific_module_private_dir "${specific_module_dir}/Private")
314+
set(source_info_file "${specific_module_private_dir}/${SWIFTFILE_ARCHITECTURE}.swiftsourceinfo")
315315
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
316316
else()
317317
set(specific_module_dir)
318-
set(specific_module_project_dir)
318+
set(specific_module_private_dir)
319319
set(source_info_file "${module_base}.swiftsourceinfo")
320320
endif()
321321
set(module_file "${module_base}.swiftmodule")
@@ -333,11 +333,6 @@ function(_compile_swift_files
333333
"-emit-module-interface-path" "${interface_file}")
334334
endif()
335335

336-
if (NOT SWIFTFILE_IS_STDLIB_CORE)
337-
list(APPEND swift_module_flags
338-
"-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
339-
endif()
340-
341336
# If we have extra regexp flags, check if we match any of the regexps. If so
342337
# add the relevant flags to our swift_flags.
343338
if (SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS OR SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS)
@@ -359,7 +354,7 @@ function(_compile_swift_files
359354
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
360355
COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT}"
361356
OPTIONAL
362-
PATTERN "Project" EXCLUDE)
357+
PATTERN "Private" EXCLUDE)
363358
else()
364359
swift_install_in_component(FILES ${module_outputs}
365360
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
@@ -500,7 +495,7 @@ function(_compile_swift_files
500495
COMMAND
501496
"${CMAKE_COMMAND}" "-E" "make_directory" ${module_dir}
502497
${specific_module_dir}
503-
${specific_module_project_dir}
498+
${specific_module_private_dir}
504499
COMMAND
505500
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
506501
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"

trunk/include/swift/AST/ASTDemangler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class ASTBuilder {
5858
using BuiltTypeDecl = swift::GenericTypeDecl *; // nominal or type alias
5959
using BuiltProtocolDecl = swift::ProtocolDecl *;
6060
explicit ASTBuilder(ASTContext &ctx) : Ctx(ctx) {}
61+
62+
/// The resolver to use for type checking, if necessary.
63+
LazyResolver *Resolver = nullptr;
6164

6265
ASTContext &getASTContext() { return Ctx; }
6366
DeclContext *getNotionalDC();

trunk/include/swift/AST/ASTTypeIDZone.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
SWIFT_TYPEID(AncestryFlags)
1919
SWIFT_TYPEID(CtorInitializerKind)
2020
SWIFT_TYPEID(GenericSignature)
21-
SWIFT_TYPEID(ParamSpecifier)
2221
SWIFT_TYPEID(PropertyWrapperBackingPropertyInfo)
2322
SWIFT_TYPEID(PropertyWrapperTypeInfo)
2423
SWIFT_TYPEID(Requirement)
@@ -34,7 +33,6 @@ SWIFT_TYPEID_NAMED(InfixOperatorDecl *, InfixOperatorDecl)
3433
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)
3534
SWIFT_TYPEID_NAMED(ModuleDecl *, ModuleDecl)
3635
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
37-
SWIFT_TYPEID_NAMED(OpaqueTypeDecl *, OpaqueTypeDecl)
3836
SWIFT_TYPEID_NAMED(OperatorDecl *, OperatorDecl)
3937
SWIFT_TYPEID_NAMED(Optional<PropertyWrapperMutability>,
4038
PropertyWrapperMutability)

trunk/include/swift/AST/ASTTypeIDs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ class IterableDeclContext;
3434
class ModuleDecl;
3535
class NominalTypeDecl;
3636
class OperatorDecl;
37-
class OpaqueTypeDecl;
38-
class ParamDecl;
39-
enum class ParamSpecifier : uint8_t;
4037
class PrecedenceGroupDecl;
4138
struct PropertyWrapperBackingPropertyInfo;
4239
struct PropertyWrapperTypeInfo;

trunk/include/swift/AST/Attr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ class DeclAttributes {
16721672
public:
16731673
template <typename ATTR, bool AllowInvalid>
16741674
using AttributeKindRange =
1675-
OptionalTransformRange<iterator_range<const_iterator>,
1675+
OptionalTransformRange<llvm::iterator_range<const_iterator>,
16761676
ToAttributeKind<ATTR, AllowInvalid>,
16771677
const_iterator>;
16781678

0 commit comments

Comments
 (0)