Skip to content

Commit

Permalink
Update UnusedImportRuleExamples for Swift 5.8 (realm#4903)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim authored Apr 18, 2023
1 parent 1892c84 commit c22d60f
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,26 @@ struct UnusedImportRuleExamples {
Example("""
import UnknownModule
func foo(error: Swift.Error) {}
"""),
""")
] + nonTriggeringExamplesVersionAdditions

#if compiler(>=5.8)
private static let nonTriggeringExamplesVersionAdditions = [
Example("""
import Foundation
let πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ = #selector(NSArray.contains(_:))
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ == πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦
""")
]
#else
private static let nonTriggeringExamplesVersionAdditions = [
Example("""
import Foundation
import ObjectiveC
let πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ = #selector(NSArray.contains(_:))
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ == πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦
""")
]
#endif

static let triggeringExamples = [
Example("""
Expand Down

0 comments on commit c22d60f

Please sign in to comment.