Skip to content

Commit b00dfad

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents 07cb3bb + bf39d72 commit b00dfad

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

lib/AST/Decl.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,10 @@ static Type mapSignatureFunctionType(ASTContext &ctx, Type type,
22262226
bool isMethod,
22272227
bool isInitializer,
22282228
unsigned curryLevels) {
2229+
if (type->hasError()) {
2230+
return type;
2231+
}
2232+
22292233
if (curryLevels == 0) {
22302234
// In an initializer, ignore optionality.
22312235
if (isInitializer) {
@@ -2316,7 +2320,12 @@ CanType ValueDecl::getOverloadSignatureType() const {
23162320
if (isa<VarDecl>(this)) {
23172321
defaultSignatureType = TupleType::getEmpty(getASTContext());
23182322
} else {
2319-
defaultSignatureType = getInterfaceType()->getCanonicalType();
2323+
defaultSignatureType = mapSignatureFunctionType(
2324+
getASTContext(), getInterfaceType(),
2325+
/*topLevelFunction=*/true,
2326+
/*isMethod=*/false,
2327+
/*isInitializer=*/false,
2328+
1)->getCanonicalType();
23202329
}
23212330

23222331
// We want to curry the default signature type with the 'self' type of the

stdlib/public/Platform/winsdk.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ module WinSDK [system] [extern_c] {
1818
}
1919

2020
module core {
21+
module acl {
22+
header "aclapi.h"
23+
export *
24+
}
25+
2126
// api-ms-win-core-errhandling-l1-1-0.dll
2227
module errhandling {
2328
header "errhandlingapi.h"

test/decl/overload.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,16 @@ struct Subscript3 {
258258
subscript(x x: Int) -> String { return "" }
259259
}
260260

261+
struct Subscript4 {
262+
subscript(f: @escaping (Int) -> Int) -> Int { // expected-note{{previously declared here}}
263+
get { return f(0) }
264+
}
265+
266+
subscript(f: (Int) -> Int) -> Int { // expected-error{{invalid redeclaration of 'subscript(_:)'}}
267+
get { return f(0) }
268+
}
269+
}
270+
261271
struct GenericSubscripts {
262272
subscript<T>(x: T) -> Int { return 0 } // expected-note{{previously declared here}}
263273
}

0 commit comments

Comments
 (0)