Skip to content

Commit

Permalink
Merge pull request #13 from SwingDev/task/fix-extracting-from-Injects…
Browse files Browse the repository at this point in the history
…-macro

Fix extracting from Injects macro
  • Loading branch information
ddanielczyk authored Apr 15, 2024
2 parents 5241d2c + 4a82c98 commit 6519743
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Templates/Inject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ func extractNeededName(_ type: Type) -> String? {
}

func extractInjects(_ type: Type, _ injectablesToInjectors: [String: String], _ protocolsToInjectables: [String: [String]]) -> [String] {
guard
let attribute = type.attributes["Injects"]?.first
else { return [] }
guard
let injectsKey = type.attributes.keys.first(where: { $0.hasPrefix("Injects") }),
let attribute = type.attributes[injectsKey]?.first
else { return [] }

let name = String(describing: attribute)

Expand Down

0 comments on commit 6519743

Please sign in to comment.