Skip to content

Commit e4c0ef6

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents ce15ecd + 24f1a46 commit e4c0ef6

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ The required version of Xcode changes frequently, and is often a beta release.
104104
Check this document or the host information on <https://ci.swift.org> for the
105105
current required version.
106106

107+
Swift's build tooling is meant to support spaces in the paths passed to them,
108+
but using spaces sometimes tickles bugs in Swift's build scripts or the tools
109+
they rely on. For example, [SR-13441](https://bugs.swift.org/browse/SR-13441)
110+
is caused by a space in the Xcode path used on macOS. If you see Swift's build
111+
tooling misbehave due to a space in a path, please
112+
[report the bug on the Swift bug tracker](https://swift.org/contributing/#reporting-bugs)
113+
and then change the path to work around it.
114+
107115
You will also need [CMake](https://cmake.org) and [Ninja](https://ninja-build.org),
108116
which can be installed via a package manager:
109117

lib/AST/ASTScopeLookup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ bool BraceStmtScope::lookupLocalsOrMembers(ArrayRef<const ASTScopeImpl *>,
519519
bool PatternEntryInitializerScope::lookupLocalsOrMembers(
520520
ArrayRef<const ASTScopeImpl *>, DeclConsumer consumer) const {
521521
// 'self' is available within the pattern initializer of a 'lazy' variable.
522-
auto *initContext = cast_or_null<PatternBindingInitializer>(
522+
auto *initContext = dyn_cast_or_null<PatternBindingInitializer>(
523523
decl->getInitContext(0));
524524
if (initContext) {
525525
if (auto *selfParam = initContext->getImplicitSelfDecl()) {
@@ -816,7 +816,7 @@ Optional<bool> ClosureBodyScope::resolveIsCascadingUseForThisScope(
816816
Optional<bool> PatternEntryInitializerScope::resolveIsCascadingUseForThisScope(
817817
Optional<bool> isCascadingUse) const {
818818
auto *const initContext = getPatternEntry().getInitContext();
819-
auto *PBI = cast_or_null<PatternBindingInitializer>(initContext);
819+
auto *PBI = dyn_cast_or_null<PatternBindingInitializer>(initContext);
820820
auto *isd = PBI ? PBI->getImplicitSelfDecl() : nullptr;
821821

822822
// 'self' is available within the pattern initializer of a 'lazy' variable.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %target-swift-frontend -typecheck %s
2+
3+
@_functionBuilder
4+
struct SillyBuilder {
5+
static func buildBlock() -> () {}
6+
}
7+
8+
struct SillyStruct {
9+
init(@SillyBuilder _: () -> ()) {}
10+
}
11+
12+
struct UsesSillyStruct {
13+
var x: Int = 0
14+
15+
func foo() {
16+
SillyStruct {
17+
let fn = {
18+
if true {
19+
_ = x
20+
}
21+
}
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)