1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module-path %t/error.swiftmodule -emit-objc-header-path %t/error.h -experimental-allow-module-with-compiler-errors %s
3
- // RUN: %FileCheck %s < %t/error.h
3
+ // RUN: %FileCheck --input-file %t/error.h %s
4
4
// RUN: %check-in-clang %t/error.h
5
5
6
6
// REQUIRES: objc_interop
7
7
8
8
import Foundation
9
9
10
+ // TODO: Ideally we'd output invalid decls regardless (so that they could eg. be used in code
11
+ // completion), but we avoid doing so for now to prevent crashes. Revisit later to handle a possibly
12
+ // invalid AST while printing the ObjectiveC header - see SR-15088.
13
+
10
14
@objc class ErrorClass : NSObject {
11
15
// CHECK: @interface ErrorClass
12
16
@objc let member : Int
13
17
// CHECK: @property {{.*}} NSInteger member;
18
+
14
19
@objc let invalidMember : undefined
15
- // TODO: Not output on invalid type
20
+ // TODO: Missing
16
21
17
22
@objc func method( ) { }
18
23
// CHECK: - (void)method;
@@ -33,10 +38,10 @@ import Foundation
33
38
}
34
39
35
40
@objc func invalidRet( ) -> undefined { }
36
- // CHECK: - (/* error */id)invalidRet
41
+ // TODO: Missing
37
42
38
43
@objc func invalidParams( a: undefined ) { }
39
- // TODO: Not output with invalid parameters
44
+ // TODO: Missing
40
45
41
46
@objc ( invalid: : )
42
47
func invalidRenamedMethod( ) { }
@@ -55,3 +60,6 @@ import Foundation
55
60
56
61
@objc class InvalidParent : undefined { }
57
62
// CHECK: @interface InvalidParent
63
+
64
+ // Used to crash during sorting due to assumptions regarding the Decl kind
65
+ @objc class ErrorClass : NSObject { }
0 commit comments