Skip to content

Commit 009b8f8

Browse files
committed
[ClangImporter] "wrong args in swift_name" is also a framework bug
...so add the new note here too.
1 parent 8168669 commit 009b8f8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,6 +2202,12 @@ ImportedType ClangImporter::Implementation::importMethodParamsAndReturnType(
22022202
SwiftContext.Diags.diagnose(methodLoc, diag::invalid_swift_name_method,
22032203
swiftParams.size() < argNames.size(),
22042204
swiftParams.size(), argNames.size());
2205+
ModuleDecl *parentModule = dc->getParentModule();
2206+
if (parentModule != ImportedHeaderUnit->getParentModule()) {
2207+
SwiftContext.Diags.diagnose(
2208+
methodLoc, diag::unresolvable_clang_decl_is_a_framework_bug,
2209+
parentModule->getName().str());
2210+
}
22052211
}
22062212
return {Type(), false};
22072213
}

test/ClangImporter/attr-swift_name.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ func test(_ i: Int) {
1919

2020
// CHECK: warning: too few parameters in swift_name attribute (expected 2; got 1)
2121
// CHECK: + (instancetype)g:(id)x outParam:(int *)foo SWIFT_NAME(init(g:));
22-
22+
// CHECK-NOT: warning:
23+
// CHECK: note: please report this issue to the owners of 'ObjCIRExtras'
2324
// CHECK-NOT: warning:
2425

2526
// CHECK: warning: too few parameters in swift_name attribute (expected 2; got 1)
2627
// CHECK: + (instancetype)testW:(id)x out:(id *)outObject SWIFT_NAME(ww(_:));
28+
// CHECK-NOT: warning:
29+
// CHECK: note: please report this issue to the owners of 'ObjCIRExtras'
30+
// CHECK-NOT: warning:
2731
}
28-
29-
// CHECK-NOT: warning:

0 commit comments

Comments
 (0)