From 563d942fcd05f286818670508df88647848f4dd8 Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Tue, 30 Nov 2021 13:42:44 -0800 Subject: [PATCH] Enable availability-checking on objc_async.swift test I'm re-enabling availability checking in the test/ClangImporter/objc_async.swift test because I want to perform an availability check in the future. In re-enabling it, I came across a warning with a fixme and a test failure on the line. Given that the expected warning has a fixme and is currently filled in with "something about missing conformance", I think this is the warning message that they were looking for. Supplying that gets the test passing with availability-checking enabled. --- test/ClangImporter/objc_async.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/ClangImporter/objc_async.swift b/test/ClangImporter/objc_async.swift index 6797691fa1acb..b442762146ae3 100644 --- a/test/ClangImporter/objc_async.swift +++ b/test/ClangImporter/objc_async.swift @@ -1,10 +1,12 @@ -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S/Inputs/custom-modules -disable-availability-checking %s -verify -verify-additional-file %swift_src_root/test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h -warn-concurrency +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S/Inputs/custom-modules %s -verify -verify-additional-file %swift_src_root/test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h -warn-concurrency // REQUIRES: objc_interop // REQUIRES: concurrency import Foundation import ObjCConcurrency +if #available(SwiftStdlib 5.5, *) { + @MainActor func onlyOnMainActor() { } func testSlowServer(slowServer: SlowServer) async throws { @@ -120,7 +122,7 @@ func testSendableAttrs( func takesSendable(_: T) {} takesSendable(sendableClass) // no-error - takesSendable(nonSendableClass) // expected-FIXME-warning{{something about missing conformance}} + takesSendable(nonSendableClass) // expected-warning{{conformance of 'NonSendableClass' to 'Sendable' is unavailable}} doSomethingConcurrently { print(sendableClass) // no-error @@ -213,3 +215,5 @@ func testMirrored(instance: ClassWithAsync) async { } } } + +} // SwiftStdlib 5.5