Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Serialization/Serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4180,7 +4180,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
writeABIOnlyCounterpart(abiRole.getCounterpartUnchecked());

// Emit attributes (if any).
for (auto Attr : D->getAttrs())
for (auto Attr : D->getSemanticAttrs())
writeDeclAttribute(D, Attr);

if (auto *value = dyn_cast<ValueDecl>(D))
Expand Down
40 changes: 40 additions & 0 deletions test/Concurrency/nonisolated_nonsending_lazy_typecheck.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// %empty-directory(%t)
// RUN: split-file %s %t

// REQUIRES: swift_feature_NonisolatedNonsendingByDefault

// Test both with and without '-experimental-lazy-typecheck'
// RUN: %swift-frontend -emit-module %t/Lib.swift -swift-version 6 -experimental-lazy-typecheck -experimental-skip-all-function-bodies -enable-upcoming-feature NonisolatedNonsendingByDefault -module-name Lib -o %t/Modules/Lib.swiftmodule
// RUN: %swift-frontend -emit-sil %t/Test.swift -I %t/Modules -swift-version 6 -enable-upcoming-feature NonisolatedNonsendingByDefault

// RUN: %swift-frontend -emit-module %t/Lib.swift -swift-version 6 -experimental-skip-all-function-bodies -enable-upcoming-feature NonisolatedNonsendingByDefault -module-name Lib -o %t/Modules/Lib.swiftmodule
// RUN: %swift-frontend -emit-sil %t/Test.swift -I %t/Modules -swift-version 6 -enable-upcoming-feature NonisolatedNonsendingByDefault

//--- Lib.swift

public final class IndexStoreDownloadManager2: Sendable {
public func withIndexStore(
body: (String) async throws -> Void
) async throws {
}
}

//--- Test.swift

import Lib

private func `import`(
indexStoreDownloadManager: IndexStoreDownloadManager2,
) async throws {
import2(
indexStoreProvider: { runWithIndexStore in
// Make sure we don't error here since `withIndexStore` is nonisolated(nonsending)
try await indexStoreDownloadManager.withIndexStore(body: runWithIndexStore)
}
)
}

func import2(
indexStoreProvider: (_ runWithIndexStore: (_ indexStore: String) async throws -> Void) async throws -> Void,
) {
}