Skip to content

Commit

Permalink
Fix generator in Swift 5.2 (#334)
Browse files Browse the repository at this point in the history
When "key.accessibility" was unknown before Swift 5.2 SouceKit would always return "internal". Some of those cases were "private" before. Now SourceKit don't return the property when it's unknown. To continue with previous behavior we now treat unknown the same as we did before.
  • Loading branch information
brentleyjones authored Apr 20, 2020
1 parent d2ade7b commit 9ea78a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Generator/Sources/NeedleFramework/Utilities/ASTUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ extension Structure {
} else {
return propertyItem.property
}
} else {
// If the accessibility identifier is missing it will be internal or private
// If it's private it will be caught by the compilation step
return propertyItem.property
}
throw GenericError.withMessage("Property missing accessibility identifier.")
}
}
}

0 comments on commit 9ea78a6

Please sign in to comment.