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: 2 additions & 0 deletions Sources/FoundationMacros/BundleMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public struct BundleMacro: SwiftSyntaxMacros.ExpressionMacro, Sendable {
return Bundle.module
#elseif SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE
#error("No resource bundle is available for this module. If resources are included elsewhere, specify the bundle manually.")
#elseif SWIFT_BUNDLE_LOOKUP_HELPER_AVAILABLE
return Bundle(for: __BundleLookupHelper.self)
#else
return Bundle(_dsoHandle: #dsohandle) ?? .main
#endif
Expand Down
4 changes: 4 additions & 0 deletions Tests/FoundationMacrosTests/BundleMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ private struct BundleMacroTests {
return Bundle.module
#elseif SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE
#error("No resource bundle is available for this module. If resources are included elsewhere, specify the bundle manually.")
#elseif SWIFT_BUNDLE_LOOKUP_HELPER_AVAILABLE
return Bundle(for: __BundleLookupHelper.self)
#else
return Bundle(_dsoHandle: #dsohandle) ?? .main
#endif
Expand All @@ -48,6 +50,8 @@ private struct BundleMacroTests {
return Bundle.module
#elseif SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE
#error("No resource bundle is available for this module. If resources are included elsewhere, specify the bundle manually.")
#elseif SWIFT_BUNDLE_LOOKUP_HELPER_AVAILABLE
return Bundle(for: __BundleLookupHelper.self)
#else
return Bundle(_dsoHandle: #dsohandle) ?? .main
#endif
Expand Down
Loading