Skip to content

Commit 191a4f8

Browse files
committed
[Concurrency] Split @objc checking into a separate test file.
1 parent 26b9e0e commit 191a4f8

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

test/attr/attr_objc.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -typecheck -verify -verify-ignore-unknown %s -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference -enable-experimental-concurrency
2-
// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -source-filename %s -function-definitions=true -prefer-type-repr=false -print-implicit-attrs=true -explode-pattern-binding-decls=true -disable-objc-attr-requires-foundation-module -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference -enable-experimental-concurrency | %FileCheck %s
3-
// RUN: not %target-swift-frontend -typecheck -dump-ast -disable-objc-attr-requires-foundation-module %s -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference -enable-experimental-concurrency > %t.ast
1+
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -typecheck -verify -verify-ignore-unknown %s -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference
2+
// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -source-filename %s -function-definitions=true -prefer-type-repr=false -print-implicit-attrs=true -explode-pattern-binding-decls=true -disable-objc-attr-requires-foundation-module -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference | %FileCheck %s
3+
// RUN: not %target-swift-frontend -typecheck -dump-ast -disable-objc-attr-requires-foundation-module %s -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference > %t.ast
44
// RUN: %FileCheck -check-prefix CHECK-DUMP %s < %t.ast
55
// REQUIRES: objc_interop
66

@@ -2381,11 +2381,3 @@ class SR12801 {
23812381
@objc subscript<T>(foo : [T]) -> Int { return 0 }
23822382
// expected-error@-1 {{subscript cannot be marked @objc because it has generic parameters}}
23832383
}
2384-
2385-
// async cannot be compiled with @objc.
2386-
class Concurrency {
2387-
@objc func doBigJob() async -> Int { return 0 } // expected-error{{'async' function cannot be represented in Objective-C}}
2388-
2389-
@objc func takeAnAsync(_ fn: () async -> Int) { } // expected-error{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
2390-
// expected-note@-1{{'async' function types cannot be represented in Objective-C}}
2391-
}

test/attr/attr_objc_async.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -typecheck -verify -verify-ignore-unknown %s -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference -enable-experimental-concurrency
2+
// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -source-filename %s -function-definitions=true -prefer-type-repr=false -print-implicit-attrs=true -explode-pattern-binding-decls=true -disable-objc-attr-requires-foundation-module -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference -enable-experimental-concurrency | %FileCheck %s
3+
// RUN: not %target-swift-frontend -typecheck -dump-ast -disable-objc-attr-requires-foundation-module %s -swift-version 4 -enable-source-import -I %S/Inputs -enable-swift3-objc-inference -enable-experimental-concurrency > %t.ast
4+
// RUN: %FileCheck -check-prefix CHECK-DUMP %s < %t.ast
5+
// REQUIRES: objc_interop
6+
7+
// async cannot be compiled with @objc.
8+
// CHECK-DUMP: class Concurrency
9+
class Concurrency {
10+
@objc func doBigJob() async -> Int { return 0 } // expected-error{{'async' function cannot be represented in Objective-C}}
11+
12+
@objc func takeAnAsync(_ fn: () async -> Int) { } // expected-error{{method cannot be marked @objc because the type of the parameter cannot be represented in Objective-C}}
13+
// expected-note@-1{{'async' function types cannot be represented in Objective-C}}
14+
}

0 commit comments

Comments
 (0)