File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed
test/ClangImporter/MixedSource Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1768,10 +1768,10 @@ shouldSuppressGenericParamsImport(const LangOptions &langOpts,
1768
1768
// the SwiftImportAsNonGeneric API note. Once we can guarantee that that
1769
1769
// attribute is present in all contexts, we can remove this check.
1770
1770
auto isFromFoundationModule = [](const clang::Decl *decl) -> bool {
1771
- Optional< clang::Module *> module = getClangSubmoduleForDecl (decl);
1771
+ clang::Module *module = getClangSubmoduleForDecl (decl). getValue ( );
1772
1772
if (!module )
1773
1773
return false ;
1774
- return module . getValue () ->getTopLevelModuleName () == " Foundation" ;
1774
+ return module ->getTopLevelModuleName () == " Foundation" ;
1775
1775
};
1776
1776
1777
1777
if (langOpts.isSwiftVersion3 () || isFromFoundationModule (decl)) {
Original file line number Diff line number Diff line change @@ -75,3 +75,8 @@ typedef int NameInCategory;
75
75
@interface ClassThatHasAProtocolTypedPropertyButMembersAreNeverLoaded
76
76
@property (weak ) id <ForwardProtoFromOtherFile> weakProtoProp;
77
77
@end
78
+
79
+
80
+ @interface GenericObjCClass <Param : id <ForwardProto>> : Base
81
+ - (instancetype )init ;
82
+ @end
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/../Inputs/custom-modules -import-objc-header %S/Inputs/mixed-target/header.h -typecheck -primary-file %S/mixed-target-using-header.swift %S/Inputs/mixed-target/other-file.swift -disable-objc-attr-requires-foundation-module -verify -swift-version 4
2
+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/../Inputs/custom-modules -import-objc-header %S/Inputs/mixed-target/header.h -emit-sil -primary-file %S/mixed-target-using-header.swift %S/Inputs/mixed-target/other-file.swift -disable-objc-attr-requires-foundation-module -o /dev/null -D SILGEN -swift-version 4
3
+
4
+ // REQUIRES: objc_interop
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ func testProtocolNamingConflict() {
75
75
d = c // expected-error {{cannot assign value of type 'ConflictingName2?' to type 'ConflictingName2Protocol?'}}
76
76
_ = d
77
77
}
78
+
79
+ func testObjCGenerics( ) {
80
+ _ = GenericObjCClass < ForwardProtoAdopter > ( )
81
+ _ = GenericObjCClass < Base > ( ) // expected-error {{type 'Base' does not conform to protocol 'ForwardProto'}}
82
+ }
78
83
#endif
79
84
80
85
func testDeclsNestedInObjCContainers( ) {
You can’t perform that action at this time.
0 commit comments