Skip to content

Commit

Permalink
ignore static property
Browse files Browse the repository at this point in the history
  • Loading branch information
winddpan committed Oct 4, 2023
1 parent 6e83a02 commit 1114708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ extension VariableDeclSyntax {
/// This syntactic check cannot account for semantic adjustments due to,
/// e.g., accessor macros or property wrappers.
var isStoredProperty: Bool {
if modifiers.compactMap({ $0.as(DeclModifierSyntax.self) }).contains(where: { $0.name.text == "static" }) {
return false
}
if bindings.count < 1 {
return false
}
Expand Down
2 changes: 2 additions & 0 deletions Tests/CodableWrapperTests/ExampleTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ struct ExampleModel: Codable {
@CodingKey("1") var testBool: Bool? = nil

var testFloats: [Float]?

static var empty: ExampleModel = .init()
}

@Codable
Expand Down

0 comments on commit 1114708

Please sign in to comment.